<!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.2900.3243" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=185512715-29032009><FONT face=Arial color=#0000ff
size=2>Applied in 2062</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>Leonid
Keller<BR><B>Sent:</B> Wednesday, March 25, 2009 4:02 PM<BR><B>To:</B>
ofw@lists.openfabrics.org<BR><B>Subject:</B> [ofw][patch][ibal] make IBBUS
start up synchronous.<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT face=Arial size=2><SPAN class=114255013-25032009>IBAL start up has
by design two stages.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=114255013-25032009> -
initialization and preparing for getting IBAL PnP events (synchronous on
fdo_start);</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=114255013-25032009> -
completing the start up upon receiving ADD_CA event (asynchronous, after
fdo_start).</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=114255013-25032009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=114255013-25032009>It means, that
IBBUS driver notifies the completion of the driver start operation before it
really has finished it.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=114255013-25032009>It causes races in
quick HCA disable/enable sequences.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=114255013-25032009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=114255013-25032009>This patch makes
IBBUS start up synchronous by adding a wait in the first stage till the end of
the second stage.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=114255013-25032009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Index:
core/al/kernel/al_pnp.c<BR>===================================================================<BR>---
core/al/kernel/al_pnp.c (revision 2055)<BR>+++
core/al/kernel/al_pnp.c (working copy)<BR>@@ -1152,6 +1152,7
@@<BR> cl_status_t cl_status;<BR> al_pnp_ca_event_t *p_event_rec;<BR> ib_ca_attr_t *p_old_ca_attr;<BR>+ uint32_t ref_cnt,
prev_cnt, i;<BR> <BR> AL_ENTER( AL_DBG_PNP );<BR> <BR>@@
-1232,9 +1233,18 @@<BR> }<BR> <BR> /* Queue the
event to the async processing manager. */<BR>- ref_al_obj(
&gp_pnp->obj );<BR>+ ref_cnt = ref_al_obj( &gp_pnp->obj
);<BR> cl_async_proc_queue( gp_async_pnp_mgr,
&p_event_rec->async_item );<BR> <BR>+ /* wait up to 3 seconds
for the end of event propagation <BR>+ It is needed for enabling quick
HCA disable/enable scenarios. */<BR>+ prev_cnt = ref_cnt -
1;<BR>+ for ( i = 0; i < 30; ++i ) {<BR>+ if (ref_cnt <=
prev_cnt)<BR>+ break;<BR>+ cl_thread_suspend(100);<BR>+ }<BR>+<BR> AL_EXIT(
AL_DBG_PNP );<BR> return
IB_SUCCESS;<BR> }<BR></FONT></DIV></BLOCKQUOTE></BODY></HTML>