[IBBUS] Fix hibernation mechanism, broken after converting IBBUS into filter driver...
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sun, 2 Nov 2008 11:36:53 +0000 (11:36 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sun, 2 Nov 2008 11:36:53 +0000 (11:36 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@1721 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

core/bus/kernel/bus_port_mgr.c
ulp/ipoib/kernel/ipoib_adapter.c

index e7b3212..b3c7026 100644 (file)
@@ -1258,6 +1258,12 @@ port_mgr_port_remove(
 \r
 hca_deref:\r
        deref_al_obj( &p_ext->h_ca->obj );\r
+       \r
+       //      Setting h_ca to be NULL forces IPoIB to start only after re-acquiring new CA object\r
+       // The latter happens in __port_was_hibernated or port_mgr_port_add functions \r
+       // after arriving IB_PNP_PORT_ADD event from IBAL\r
+       p_ext->h_ca = NULL;\r
+\r
        cl_mutex_release( &p_port_mgr->pdo_mutex );\r
 \r
        BUS_EXIT( BUS_DBG_PNP );\r
@@ -1848,13 +1854,10 @@ port_query_ipoib_ifc(
        CL_ASSERT( KeGetCurrentIrql() < DISPATCH_LEVEL );\r
 \r
        p_ext = p_dev_obj->DeviceExtension;\r
-       if      (p_ext->pdo.b_hibernating) {\r
-               // Can't continue within hibernation stage\r
-               return STATUS_UNSUCCESSFUL;\r
-       }\r
-       BUS_TRACE( BUS_DBG_PNP, ("Query i/f for %s: PDO %p (=%p),ext %p, present %d, missing %d .\n",\r
+\r
+       BUS_TRACE( BUS_DBG_PNP, ("Query i/f for %s: PDO %p (=%p),ext %p, present %d, missing %d, hibernated %d .\n",\r
                p_ext->pdo.cl_ext.vfptr_pnp_po->identity, p_ext->pdo.cl_ext.p_self_do, \r
-               p_dev_obj, p_ext, p_ext->pdo.b_present, p_ext->pdo.b_reported_missing ) );\r
+               p_dev_obj, p_ext, p_ext->pdo.b_present, p_ext->pdo.b_reported_missing, p_ext->pdo.b_hibernating ) );\r
 \r
        /* Get the interface. */\r
        status = cl_fwd_query_ifc(\r
index d84574f..d94fefc 100644 (file)
@@ -498,6 +498,7 @@ __adapter_free(
                        p_adapter->p_ifc->close_al( p_adapter->h_al );\r
 \r
                cl_free( p_adapter->p_ifc );\r
+               p_adapter->p_ifc = NULL;\r
        }\r
 \r
        cl_vector_destroy( &p_adapter->ip_vector );\r