[IPoIB] adapter could be left in INIT state.
authortzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 11 Feb 2009 10:08:30 +0000 (10:08 +0000)
committertzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 11 Feb 2009 10:08:30 +0000 (10:08 +0000)
signed off by: alex.estrin@qlogic.com

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

ulp/ipoib/kernel/ipoib_port.c

index 937cf5d..8f68c88 100644 (file)
@@ -5203,14 +5203,28 @@ ipoib_port_up(
        IPOIB_ENTER( IPOIB_DBG_INIT );\r
 \r
        cl_obj_lock( &p_port->obj );\r
-       if ((p_port->state == IB_QPS_INIT) ||\r
-               (p_port->state == IB_QPS_RTS)){\r
+       if ( p_port->state == IB_QPS_INIT ) \r
+       {\r
                cl_obj_unlock( &p_port->obj );\r
-               status = STATUS_SUCCESS;\r
+               status = IB_SUCCESS;\r
                IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
                        ("p_port->state = %d - Aborting.\n", p_port->state) );        \r
                goto up_done;\r
        }\r
+       else if ( p_port->state == IB_QPS_RTS )\r
+       {\r
+               cl_obj_unlock( &p_port->obj );\r
+               cl_obj_lock( &p_port->p_adapter->obj );\r
+               if( p_port->p_adapter->state == IB_PNP_PORT_INIT )\r
+               {\r
+                       p_port->p_adapter->state = IB_PNP_PORT_ACTIVE;\r
+               }\r
+               cl_obj_unlock( &p_port->p_adapter->obj );\r
+               status = IB_SUCCESS;\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
+                       ("Port init is done. p_port->state = %d.\n", p_port->state ) );\r
+               goto up_done;\r
+       }\r
        p_port->state = IB_QPS_INIT;\r
        cl_obj_unlock( &p_port->obj );  \r
 \r