<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16587" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=980120210-28102008><FONT face=Arial color=#0000ff
size=2>Checked in on 1702, 1703</FONT></SPAN></DIV>
<DIV><SPAN class=980120210-28102008><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=980120210-28102008><FONT face=Arial color=#0000ff
size=2>Thanks</FONT></SPAN></DIV>
<DIV><SPAN class=980120210-28102008><FONT face=Arial color=#0000ff
size=2>Tzachi</FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> ofw-bounces@lists.openfabrics.org
[mailto:ofw-bounces@lists.openfabrics.org] <B>On Behalf Of </B>Tzachi
Dar<BR><B>Sent:</B> Tuesday, October 28, 2008 12:36 AM<BR><B>To:</B>
ofw@lists.openfabrics.org<BR><B>Subject:</B> [ofw] patch: Fix bug
1307(https://bugs.openfabrics.org//show_bug.cgi?id=1307)<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT face=Arial size=2><SPAN class=734480115-27102008>This bug happens
when trying to disable the HCA while opensm is running.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=734480115-27102008>From the
perspective of ib_bus there is a pnp query of query_remove.
</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=734480115-27102008>The bus driver
answers that remove can happen and also calls cl_obj_destroy(
&p_ext->p_port_mgr->obj );</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=734480115-27102008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=734480115-27102008>Since the HCA
answers query_remove with no, we get a cancel_remvove. Which we don't handle.
(that is </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=734480115-27102008>p_port_mgr is not
being created again).</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=734480115-27102008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=734480115-27102008>More than that,
since now there is no bus driver we also get a surprise removal from the pnp
manager.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=734480115-27102008>In this function
we have been using p_port_mgr which is now null => blue
screen.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=734480115-27102008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=734480115-27102008>Our solution to
the problem is simple, we only destroy p_port_mgr on the function
fdo_release_resources()</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=734480115-27102008>(we do nothing on
the query remove).</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=734480115-27102008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=734480115-27102008>Please review the
attached patch.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=734480115-27102008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=734480115-27102008>Index:
Q:/projinf2/trunk/core/bus/kernel/bus_pnp.c<BR>===================================================================<BR>---
Q:/projinf2/trunk/core/bus/kernel/bus_pnp.c (revision 3373)<BR>+++
Q:/projinf2/trunk/core/bus/kernel/bus_pnp.c (working copy)<BR>@@ -428,13
+428,6 @@<BR> <BR> //TODO: Fail outstanding I/O
operations.<BR> <BR>- if ( p_ext->p_port_mgr &&
p_bfi->p_port_mgr )<BR>- cl_obj_destroy(
&p_ext->p_port_mgr->obj );<BR>-<BR>- if ( p_ext->p_iou_mgr
&& p_bfi->p_iou_mgr )<BR>- cl_obj_destroy(
&p_ext->p_iou_mgr->obj );<BR>-<BR>-<BR> *p_action =
IrpSkip;<BR> /* The FDO driver must set the status even when
passing down. */<BR> p_irp->IoStatus.Status =
STATUS_SUCCESS;<BR>@@ -468,11 +461,15 @@<BR> <BR> //TODO: Fail
outstanding I/O operations.<BR> <BR>- if ( p_ext->p_port_mgr
&& p_bfi->p_port_mgr )<BR>+ if ( p_ext->p_port_mgr
&& p_bfi->p_port_mgr ) {<BR> cl_obj_destroy(
&p_ext->p_port_mgr->obj );<BR>+ p_ext->p_port_mgr =
NULL;<BR>+ }<BR> <BR>- if ( p_ext->p_iou_mgr &&
p_bfi->p_iou_mgr )<BR>+ if ( p_ext->p_iou_mgr &&
p_bfi->p_iou_mgr ) {<BR> cl_obj_destroy(
&p_ext->p_iou_mgr->obj );<BR>+ p_ext->p_iou_mgr =
NULL;<BR>+ }<BR> <BR> BUS_PRINT( BUS_DBG_PNP, ("Releasing
BusFilter %s\n", p_bfi->whoami ));<BR> if (p_bfi)
{<BR></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=734480115-27102008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=734480115-27102008>Thanks</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=734480115-27102008>Tzachi</SPAN></FONT></DIV></BLOCKQUOTE></BODY></HTML>