[IPoIB] Fix driver verifier deadlock resulting from
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 12 May 2006 18:16:13 +0000 (18:16 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 12 May 2006 18:16:13 +0000 (18:16 +0000)
query synchronization patch.

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

ulp/ipoib/kernel/ipoib_adapter.c

index d62345f..d6e2aac 100644 (file)
@@ -875,34 +875,35 @@ ipoib_set_rate(
        IN              const   uint8_t                                         link_width, \r
        IN              const   uint8_t                                         link_speed )\r
 {\r
+       uint32_t        rate;\r
+\r
        IPOIB_ENTER( IPOIB_DBG_INIT );\r
 \r
-       cl_obj_lock( &p_adapter->obj );\r
        /* Set the link speed based on the IB link speed (1x vs 4x, etc). */\r
        switch( link_speed )\r
        {\r
        case IB_LINK_SPEED_ACTIVE_2_5:\r
                IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
                        ("Link speed is 2.5Gs\n") );\r
-               p_adapter->rate = IB_LINK_SPEED_ACTIVE_2_5;\r
+               rate = IB_LINK_SPEED_ACTIVE_2_5;\r
                break;\r
 \r
        case IB_LINK_SPEED_ACTIVE_5:\r
                IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
                        ("Link speed is 5G\n") );\r
-               p_adapter->rate = IB_LINK_SPEED_ACTIVE_5;\r
+               rate = IB_LINK_SPEED_ACTIVE_5;\r
                break;\r
 \r
        case IB_LINK_SPEED_ACTIVE_10:\r
                IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
                        ("Link speed is 10G\n") );\r
-               p_adapter->rate = IB_LINK_SPEED_ACTIVE_10;\r
+               rate = IB_LINK_SPEED_ACTIVE_10;\r
                break;\r
 \r
        default:\r
                IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Invalid link speed %d.\n", link_speed) );\r
-               p_adapter->rate = 0;\r
+               rate = 0;\r
        }\r
 \r
        switch( link_width )\r
@@ -910,27 +911,28 @@ ipoib_set_rate(
        case IB_LINK_WIDTH_ACTIVE_1X:\r
                IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
                        ("Link width is 1X\n") );\r
-               p_adapter->rate *= ONE_X_IN_100BPS;\r
+               rate *= ONE_X_IN_100BPS;\r
                break;\r
 \r
        case IB_LINK_WIDTH_ACTIVE_4X:\r
                IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
                        ("Link width is 4X\n") );\r
-               p_adapter->rate *= FOUR_X_IN_100BPS;\r
+               rate *= FOUR_X_IN_100BPS;\r
                break;\r
 \r
        case IB_LINK_WIDTH_ACTIVE_12X:\r
                IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
                        ("Link width is 12X\n") );\r
-               p_adapter->rate *= TWELVE_X_IN_100BPS;\r
+               rate *= TWELVE_X_IN_100BPS;\r
                break;\r
 \r
        default:\r
                IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Invalid link rate (%d).\n", link_width) );\r
-               p_adapter->rate = 0;\r
+               rate = 0;\r
        }\r
-       cl_obj_unlock( &p_adapter->obj );\r
+\r
+       p_adapter->rate = rate;\r
        IPOIB_EXIT( IPOIB_DBG_INIT );\r
 }\r
 \r