From 7061132228d350de9270b8239065baf7d8bff6fc Mon Sep 17 00:00:00 2001 From: Alex Naslednikov Date: Wed, 10 Nov 2010 09:29:48 +0000 Subject: [PATCH] [IPOIB_NDIS6_CM] 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 | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.cpp b/trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.cpp index 94e32eb4..5949453c 100644 --- a/trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.cpp +++ b/trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.cpp @@ -1024,7 +1024,6 @@ ipoib_reset_adapter( { h_pnp = p_adapter->h_pnp; p_adapter->h_pnp = NULL; - status = p_adapter->p_ifc->dereg_pnp( h_pnp, __ipoib_pnp_dereg ); // Wait until NDIS will return all indicated NBLs that were received // Avoid shutting the shutter twice @@ -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()) ); } KeReleaseInStackQueuedSpinLock( &hdl ); + status = p_adapter->p_ifc->dereg_pnp( h_pnp, __ipoib_pnp_dereg ); if( status == IB_SUCCESS ) + { status = IB_NOT_DONE; + } } else { status = __ipoib_pnp_reg( p_adapter, IB_PNP_FLAG_REG_COMPLETE ); - if( status == IB_SUCCESS ) - p_adapter->hung = FALSE; - } - if (status == IB_NOT_DONE) { - p_adapter->reset = TRUE; } - else { + + if ( status != IB_NOT_DONE ) + { //do not call to __ipoib_complete_reset, because we return completion status directly from here p_adapter->reset = FALSE; -- 2.46.0