]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[IPOIB_NDIS6_CM]
authorAlex Naslednikov <alex@mellanox.co.il>
Wed, 10 Nov 2010 09:29:48 +0000 (09:29 +0000)
committerAlex Naslednikov <alex@mellanox.co.il>
Wed, 10 Nov 2010 09:29:48 +0000 (09:29 +0000)
Fix race when __ipoib_adapter_reset will be called before shutter_shut
[MLNX 2.1.3.6793]

git-svn-id: svn://openib.tc.cornell.edu/gen1@2985 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.cpp

index 94e32eb4db316c5b190a3c096a301f2ed8b68de9..5949453c77e41a51fef3748382ce147292f02612 100644 (file)
@@ -1024,7 +1024,6 @@ ipoib_reset_adapter(
        {\r
                h_pnp = p_adapter->h_pnp;\r
                p_adapter->h_pnp  = NULL;\r
-               status = p_adapter->p_ifc->dereg_pnp( h_pnp, __ipoib_pnp_dereg );\r
                \r
                // Wait until NDIS will return all indicated NBLs that were received\r
                // Avoid shutting the shutter twice\r
@@ -1037,20 +1036,20 @@ ipoib_reset_adapter(
                        ("[%I64u] ipoib_state was IPOIB_RUNNING and IPOIB_RESET_OR_DOWN flag was set \n", cl_get_time_stamp()) );\r
                }\r
                KeReleaseInStackQueuedSpinLock( &hdl );\r
+               status = p_adapter->p_ifc->dereg_pnp( h_pnp, __ipoib_pnp_dereg );\r
                \r
                if( status == IB_SUCCESS )\r
+               {\r
                        status = IB_NOT_DONE;\r
+               }\r
        }\r
        else\r
        {\r
                status = __ipoib_pnp_reg( p_adapter, IB_PNP_FLAG_REG_COMPLETE );\r
-               if( status == IB_SUCCESS )\r
-                       p_adapter->hung = FALSE;\r
-       }\r
-       if (status == IB_NOT_DONE) {\r
-               p_adapter->reset = TRUE;\r
        }\r
-       else {\r
+       \r
+       if ( status != IB_NOT_DONE ) \r
+       {\r
                //do not call to  __ipoib_complete_reset, because we return completion status directly from here\r
                p_adapter->reset = FALSE; \r
                \r