[BUS] prevent disable operation from firing ref count ASSERT(). Clear hca field so...
authorstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 16 Apr 2009 17:25:14 +0000 (17:25 +0000)
committerstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 16 Apr 2009 17:25:14 +0000 (17:25 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2102 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

core/bus/kernel/bus_iou_mgr.c

index 2b46404..cdc0c62 100644 (file)
@@ -357,6 +357,7 @@ destroying_iou_mgr(
                status = ib_dereg_pnp( bus_globals.h_pnp_iou, NULL );\r
                bus_globals.h_pnp_iou = NULL;\r
                CL_ASSERT( status == IB_SUCCESS );\r
+               BUS_TRACE(BUS_DBG_PNP, ("%s deregister IOU PNP\n", p_bfi->whoami) );\r
        }\r
        cl_obj_deref( p_bfi->p_iou_mgr_obj );\r
 \r
@@ -426,11 +427,6 @@ free_iou_mgr(
                                        p_bfi->whoami, p_ext->cl_ext.vfptr_pnp_po->identity,\r
                                        p_ext->cl_ext.p_self_do, p_ext ) );\r
 \r
-               BUS_TRACE( BUS_DBG_PNP,("%s p_ext->h_ca->obj.state %d ref_cnt %d\n",\r
-                                       p_bfi->whoami,\r
-                                       p_ext->h_ca->obj.state,\r
-                                       p_ext->h_ca->obj.ref_cnt));\r
-\r
                IoDeleteDevice( p_ext->cl_ext.p_self_do );\r
        }\r
 \r
@@ -868,7 +864,8 @@ iou_mgr_iou_remove(
                        p_ext->cl_ext.vfptr_pnp_po->identity, p_ext->cl_ext.p_self_do,\r
                        p_ext, p_ext->b_present, \r
                        p_ext->b_reported_missing, p_ext->b_hibernating ) );\r
-               goto hca_deref;\r
+               deref_al_obj( &p_ext->h_ca->obj );\r
+               goto xit;\r
        }\r
 \r
        p_ext->b_present = FALSE;\r
@@ -890,9 +887,10 @@ iou_mgr_iou_remove(
        /* free PNP context */\r
        cl_free( p_ctx );\r
        p_pnp_rec->pnp_rec.context = NULL;\r
-\r
-hca_deref:\r
        deref_al_obj( &p_ext->h_ca->obj );\r
+       p_ext->h_ca = NULL;     // for free_iou_mgr()\r
+\r
+xit:\r
        cl_mutex_release( &gp_iou_mgr->pdo_mutex );\r
 \r
        BUS_EXIT( BUS_DBG_PNP );\r