some ipoib global objects are under destruction (like p_adapter ->p_port).
It was tested by night regression run on IPoIB driver
Adding shutter_shut for Adapter Reset flow
Signed-off by: Alexander Naslednikov (xalex at mellanox.co.il)
git-svn-id: svn://openib.tc.cornell.edu/gen1@2963
ad392aa1-c5ef-ae45-8dd8-
e69d62a5ef86
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
+ // Wait until NDIS will return all indicated NBLs that were received\r
+ shutter_shut( &p_adapter->recv_shutter );\r
if( status == IB_SUCCESS )\r
status = IB_NOT_DONE;\r
}\r
IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_OBJ,\r
("ref type %d ref_cnt %d\n", ref_init, p_port->obj.ref_cnt) );\r
#endif\r
- // The port is started as paused and NDIS calls latter to ipoib_restart. We\r
- // shut the recv_shuter for now and alive it on ipoib_restart. We did\r
- // it in this way since MpInitializeInternal also calls in reset and than\r
- // we need to set the rec ref count to 1 //TODO !!!!!!!!!!1\r
- //\r
+ /* The steps of the initialization are as depicted below:\r
+ I. adapter_init() calls shutter_init(), the shutter counter is set to 0\r
+ II. ipoib_pnp_cb() calls to ipoib_port_init() that calls to __port_init() that SHOULD set shutter counter to -MAX_OPERATIONS\r
+ That is, the code below should call to shutter_shut()\r
+ III.NDIS calls to ipoib_restart() that calls to shutter_alive. Now, shutter_counter is again 0.\r
+ IV. NDIS call to ipoib_pause() that sets the adapter to pause state, calls to shutter_shut. \r
+ Now, the counter is again equals to -MAX_OPERATIONS\r
+ V. NDIS calls to ipoib_restart that calls to shutter_alive. Shutter counter is 0 and we can start working\r
+ */\r
\r
if ( p_adapter->ipoib_state == IPOIB_INIT) {\r
IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_RECV,\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
+ // Wait until NDIS will return all indicated NBLs that were received\r
+ shutter_shut( &p_adapter->recv_shutter );\r
if( status == IB_SUCCESS )\r
status = IB_NOT_DONE;\r
}\r
IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_OBJ,\r
("ref type %d ref_cnt %d\n", ref_init, p_port->obj.ref_cnt) );\r
#endif\r
- // The port is started as paused and NDIS calls latter to ipoib_restart. We\r
- // shut the recv_shuter for now and alive it on ipoib_restart. We did\r
- // it in this way since MpInitializeInternal also calls in reset and than\r
- // we need to set the rec ref count to 1 //TODO !!!!!!!!!!1\r
- //\r
+ /* The steps of the initialization are as depicted below:\r
+ I. adapter_init() calls shutter_init(), the shutter counter is set to 0\r
+ II. ipoib_pnp_cb() calls to ipoib_port_init() that calls to __port_init() that SHOULD set shutter counter to -MAX_OPERATIONS\r
+ That is, the code below should call to shutter_shut()\r
+ III.NDIS calls to ipoib_restart() that calls to shutter_alive. Now, shutter_counter is again 0.\r
+ IV. NDIS call to ipoib_pause() that sets the adapter to pause state, calls to shutter_shut. \r
+ Now, the counter is again equals to -MAX_OPERATIONS\r
+ V. NDIS calls to ipoib_restart that calls to shutter_alive. Shutter counter is 0 and we can start working\r
+ */\r
\r
if ( p_adapter->ipoib_state == IPOIB_INIT) {\r
IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_RECV,\r