[ofw] patch: Fix bug 1307(https://bugs.openfabrics.org//show_bug.cgi?id=1307)

Tzachi Dar tzachid at mellanox.co.il
Tue Oct 28 03:02:29 PDT 2008


Checked in on 1702, 1703
 
Thanks
Tzachi


________________________________

	From: ofw-bounces at lists.openfabrics.org
[mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Tzachi Dar
	Sent: Tuesday, October 28, 2008 12:36 AM
	To: ofw at lists.openfabrics.org
	Subject: [ofw] patch: Fix bug
1307(https://bugs.openfabrics.org//show_bug.cgi?id=1307)
	
	
	This bug happens when trying to disable the HCA while opensm is
running.
	From the perspective of ib_bus there is a pnp query of
query_remove. 
	The bus driver answers that remove can happen and also calls
cl_obj_destroy( &p_ext->p_port_mgr->obj );
	 
	Since the HCA answers query_remove with no, we get a
cancel_remvove. Which we don't handle. (that is 
	p_port_mgr is not being created again).
	 
	More than that, since now there is no bus driver we also get a
surprise removal from the pnp manager.
	In this function we have been using p_port_mgr which is now null
=> blue screen.
	 
	Our solution to the problem is simple, we only destroy
p_port_mgr on the function fdo_release_resources()
	(we do nothing on the query remove).
	 
	Please review the attached patch.
	 
	Index: Q:/projinf2/trunk/core/bus/kernel/bus_pnp.c
	
===================================================================
	--- Q:/projinf2/trunk/core/bus/kernel/bus_pnp.c (revision 3373)
	+++ Q:/projinf2/trunk/core/bus/kernel/bus_pnp.c (working copy)
	@@ -428,13 +428,6 @@
	 
	  //TODO: Fail outstanding I/O operations.
	 
	- if ( p_ext->p_port_mgr && p_bfi->p_port_mgr )
	-  cl_obj_destroy( &p_ext->p_port_mgr->obj );
	-
	- if ( p_ext->p_iou_mgr && p_bfi->p_iou_mgr )
	-   cl_obj_destroy( &p_ext->p_iou_mgr->obj );
	-
	-
	  *p_action = IrpSkip;
	  /* The FDO driver must set the status even when passing down.
*/
	  p_irp->IoStatus.Status = STATUS_SUCCESS;
	@@ -468,11 +461,15 @@
	 
	  //TODO: Fail outstanding I/O operations.
	 
	- if ( p_ext->p_port_mgr && p_bfi->p_port_mgr )
	+ if ( p_ext->p_port_mgr && p_bfi->p_port_mgr ) {
	   cl_obj_destroy( &p_ext->p_port_mgr->obj );
	+  p_ext->p_port_mgr = NULL;
	+ }
	 
	- if ( p_ext->p_iou_mgr && p_bfi->p_iou_mgr )
	+ if ( p_ext->p_iou_mgr && p_bfi->p_iou_mgr ) {
	    cl_obj_destroy( &p_ext->p_iou_mgr->obj );
	+  p_ext->p_iou_mgr = NULL;
	+ }
	 
	  BUS_PRINT( BUS_DBG_PNP, ("Releasing BusFilter %s\n",
p_bfi->whoami ));
	  if (p_bfi) {
	
	 
	Thanks
	Tzachi

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20081028/db69a64a/attachment.html>


More information about the ofw mailing list