[IBBUS,COMPLIB] Eliminate re-initialization of the stop lock. Crash reported upon...
authorstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 2 Sep 2009 16:43:38 +0000 (16:43 +0000)
committerstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 2 Sep 2009 16:43:38 +0000 (16:43 +0000)
Signed-off by Leonid Keller leonid@mellanox.co.il

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

core/bus/kernel/bus_pnp.c
core/complib/kernel/cl_pnp_po.c

index 82ffddd..65a024e 100644 (file)
@@ -216,7 +216,6 @@ bus_add_device(
                        RtlZeroMemory(p_ext, sizeof *p_ext);\r
                        cl_init_pnp_po_ext( g_ControlDeviceObject, NULL, \r
                                                                NULL, bus_globals.dbg_lvl, NULL, NULL );\r
-                       IoInitializeRemoveLock( &p_ext->cl_ext.stop_lock, 'dtci', 0, 1000 );\r
 \r
                        /* enable user-mode access to IB stack */\r
                        BUS_PRINT( BUS_DBG_PNP, ("Remove-n-reCreate dos_name symlink\n") );\r
index ea8d1a2..a984240 100644 (file)
@@ -136,7 +136,9 @@ cl_init_pnp_po_ext(
 \r
        /* Store the pointer to our own device. */\r
        p_ext->p_self_do = p_dev_obj;\r
+\r
        IoInitializeRemoveLock( &p_ext->remove_lock, 'bilc', 15, 1000 );\r
+       IoInitializeRemoveLock( &p_ext->stop_lock, 'dtci', 0, 1000 );\r
 \r
        /* Initialize the PnP states. */\r
        p_ext->pnp_state = NotStarted;\r
@@ -428,15 +430,6 @@ __start(
        if( NT_SUCCESS( status ) )\r
                cl_set_pnp_state( p_ext, Started );\r
 \r
-       /*\r
-        * If we get the start request when we're already started, don't \r
-        * re-initialize the stop lock.\r
-        */\r
-       if( p_ext->last_pnp_state != Started ) {\r
-               CL_TRACE( CL_DBG_PNP, p_ext->dbg_lvl, ("IoInitializeRemoveLock: stop_lock %p[\n", &p_ext->stop_lock));\r
-               IoInitializeRemoveLock( &p_ext->stop_lock, 'dtci', 0, 1000 );\r
-       }\r
-\r
        CL_EXIT( CL_DBG_PNP, p_ext->dbg_lvl );\r
        return status;\r
 }\r
@@ -555,33 +548,6 @@ __cancel_stop(
                return status;\r
        }\r
 \r
-       if( p_ext->last_pnp_state == Started )\r
-       {\r
-               /*\r
-                * Re-initialize the stop lock before rolling back the PnP\r
-                * state so that there's no contention while it's uninitialized.\r
-                */\r
-               CL_TRACE( CL_DBG_PNP, p_ext->dbg_lvl, ("IoInitializeRemoveLock: stop_lock %p[\n", &p_ext->stop_lock));\r
-               IoInitializeRemoveLock( &p_ext->stop_lock, 'dtci', 0, 1000 );\r
-#if 0          \r
-               // leo: it seems like a bug, because it can never get released\r
-               {\r
-               /* \r
-                * Acquire the stop lock to allow releasing and waiting when stopping.\r
-                */\r
-                       NTSTATUS                        status1;\r
-                       CL_TRACE( CL_DBG_PNP, p_ext->dbg_lvl, ("IoAcquireRemoveLock: stop_lock %p[\n", &p_ext->stop_lock));\r
-                       status1 = IoAcquireRemoveLock( &p_ext->stop_lock, NULL );\r
-                       if( !NT_SUCCESS( status1 ) )\r
-                       {\r
-                               CL_TRACE( CL_DBG_ERROR, p_ext->dbg_lvl, \r
-                                       ("IoAcquireRemoveLock returned %08x. Continue anyway ...\n", status) );\r
-                       }\r
-                       CL_TRACE( CL_DBG_PNP, p_ext->dbg_lvl, ("IoAcquireRemoveLock: stop_lock ]\n"));\r
-               }\r
-#endif         \r
-       }\r
-\r
        /* Return to the previous PnP state. */\r
        cl_rollback_pnp_state( p_ext );\r
 \r