winverbs: release CM interface only once per reference
authorshefty <shefty@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 29 Apr 2009 23:02:09 +0000 (23:02 +0000)
committershefty <shefty@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 29 Apr 2009 23:02:09 +0000 (23:02 +0000)
The CM interface is not bound to a device, and is only acquired once by the winverbs driver.  Release the CM interface only once after all devices have been removed, not once per hardware device.

This should fix issues enabling/disabling HCA drivers with multiple HCAs present in a single system.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2141 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

core/winverbs/kernel/wv_driver.c

index e317058..434d144 100644 (file)
@@ -554,15 +554,14 @@ static VOID WvRdmaDeviceCleanup(WDFDEVICE Device)
                KeWaitForSingleObject(&pdev->Event, Executive, KernelMode, FALSE, NULL);\r
        }\r
 \r
-       if (IbCmInterface.CM.create_id != NULL) {\r
-               IbCmInterface.InterfaceHeader.InterfaceDereference(IbCmInterface.\r
-                                                                                                                  InterfaceHeader.Context);\r
-       }\r
-\r
        pdev->Interface.InterfaceHeader.InterfaceDereference(pdev->Interface.\r
                                                                                                                 InterfaceHeader.Context);\r
 \r
        if (destroy) {\r
+               if (IbCmInterface.CM.create_id != NULL) {\r
+                       IbCmInterface.InterfaceHeader.InterfaceDereference(IbCmInterface.\r
+                                                                                                                          InterfaceHeader.Context);\r
+               }\r
                WdfObjectDelete(ctrldev);\r
        }\r
 }\r