<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =
"urn:schemas-microsoft-com:vml" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word" xmlns:m =
"http://schemas.microsoft.com/office/2004/12/omml"><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.23501">
<STYLE>@font-face {
font-family: Wingdings;
}
@font-face {
font-family: Cambria Math;
}
@font-face {
font-family: Calibri;
}
@font-face {
font-family: Tahoma;
}
@page WordSection1 {size: 8.5in 11.0in; margin: 1.0in 1.0in 1.0in 1.0in; }
P.MsoNormal {
MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman","serif"; FONT-SIZE: 12pt
}
LI.MsoNormal {
MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman","serif"; FONT-SIZE: 12pt
}
DIV.MsoNormal {
MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman","serif"; FONT-SIZE: 12pt
}
A:link {
COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlink {
COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
A:visited {
COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlinkFollowed {
COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
P.MsoAcetate {
MARGIN: 0in 0in 0pt; FONT-FAMILY: "Tahoma","sans-serif"; FONT-SIZE: 8pt; mso-style-priority: 99; mso-style-link: "Balloon Text Char"
}
LI.MsoAcetate {
MARGIN: 0in 0in 0pt; FONT-FAMILY: "Tahoma","sans-serif"; FONT-SIZE: 8pt; mso-style-priority: 99; mso-style-link: "Balloon Text Char"
}
DIV.MsoAcetate {
MARGIN: 0in 0in 0pt; FONT-FAMILY: "Tahoma","sans-serif"; FONT-SIZE: 8pt; mso-style-priority: 99; mso-style-link: "Balloon Text Char"
}
P.MsoListParagraph {
MARGIN: 0in 0in 0pt 0.5in; FONT-FAMILY: "Times New Roman","serif"; FONT-SIZE: 12pt; mso-style-priority: 34
}
LI.MsoListParagraph {
MARGIN: 0in 0in 0pt 0.5in; FONT-FAMILY: "Times New Roman","serif"; FONT-SIZE: 12pt; mso-style-priority: 34
}
DIV.MsoListParagraph {
MARGIN: 0in 0in 0pt 0.5in; FONT-FAMILY: "Times New Roman","serif"; FONT-SIZE: 12pt; mso-style-priority: 34
}
P.emailquote {
FONT-FAMILY: "Times New Roman","serif"; MARGIN-LEFT: 1pt; FONT-SIZE: 12pt; MARGIN-RIGHT: 0in; mso-style-name: emailquote; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto
}
LI.emailquote {
FONT-FAMILY: "Times New Roman","serif"; MARGIN-LEFT: 1pt; FONT-SIZE: 12pt; MARGIN-RIGHT: 0in; mso-style-name: emailquote; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto
}
DIV.emailquote {
FONT-FAMILY: "Times New Roman","serif"; MARGIN-LEFT: 1pt; FONT-SIZE: 12pt; MARGIN-RIGHT: 0in; mso-style-name: emailquote; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto
}
SPAN.EmailStyle19 {
FONT-FAMILY: "Calibri","sans-serif"; COLOR: #1f497d; mso-style-type: personal
}
SPAN.EmailStyle20 {
FONT-FAMILY: "Calibri","sans-serif"; COLOR: #1f497d; mso-style-type: personal
}
SPAN.BalloonTextChar {
FONT-FAMILY: "Tahoma","sans-serif"; mso-style-priority: 99; mso-style-link: "Balloon Text"; mso-style-name: "Balloon Text Char"
}
SPAN.EmailStyle23 {
FONT-FAMILY: "Calibri","sans-serif"; COLOR: #1f497d; mso-style-type: personal-reply
}
.MsoChpDefault {
FONT-SIZE: 10pt; mso-style-type: export-only
}
DIV.WordSection1 {
page: WordSection1
}
OL {
MARGIN-BOTTOM: 0in
}
UL {
MARGIN-BOTTOM: 0in
}
</STYLE>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=EN-US link=blue vLink=purple>
<DIV dir=ltr align=left><SPAN class=106462423-18072013><FONT color=#0000ff
size=2 face=Arial>Judy,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=106462423-18072013><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=106462423-18072013><FONT color=#0000ff
size=2 face=Arial>I feel the same way as well. Let's wait for the response from
LSI and Intel on this. If they all agree, I will go ahead remove
it.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=106462423-18072013><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=106462423-18072013><FONT color=#0000ff
size=2 face=Arial>Thanks,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=106462423-18072013><FONT color=#0000ff
size=2 face=Arial>Alex</FONT></SPAN></DIV><BR>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> nvmewin-bounces@lists.openfabrics.org
[mailto:nvmewin-bounces@lists.openfabrics.org] <B>On Behalf Of </B>Judy
Brock-SSI<BR><B>Sent:</B> Thursday, July 18, 2013 4:17 PM<BR><B>To:</B> Judy
Brock-SSI; nvmewin@lists.openfabrics.org<BR><B>Subject:</B> [nvmewin]
COMPLETE_IN_DPC flag & relationship to NvmeStartio path critical section
handling not protected from NVMe ISR?<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=WordSection1>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt">So
it looks like the reason this problem was not seen before is because it
only surfaces when the COMPLETE_IN_DPC compile flag is <B>not</B> set. In other
words, the COMPLETE_IN_ISR path is broken because it accesses our
HwDeviceExtension without being synchronized with other paths in the driver
which do the same.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt">We
can either fix the path which does completions in the ISR or get rid of that
option entirely. Since it’s generally considered bad practice to do that kind of
work in an ISR because it’s supposed to be as lean and mean as possible, would
the team be adverse to getting rid of the logic which optionally allows
completions to be handled by the ISR?<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt">If
we insist on retaining it, a) we should come up with a good reason why and
b) we should fix it asap because it is definitely not safe to use in its present
form.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt">Personally
I vote for removal - we wouldn’t need the COMPLETE_IN_DPC flag either
anymore if we go that route.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt">Thanks,<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt">Judy<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt"><o:p> </o:p></SPAN></P>
<DIV>
<DIV
style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<P class=MsoNormal><B><SPAN
style="FONT-FAMILY: 'Tahoma','sans-serif'; FONT-SIZE: 10pt">From:</SPAN></B><SPAN
style="FONT-FAMILY: 'Tahoma','sans-serif'; FONT-SIZE: 10pt"> Judy Brock-SSI
<BR><B>Sent:</B> Thursday, July 18, 2013 6:22 AM<BR><B>To:</B> Judy Brock-SSI;
'nvmewin@lists.openfabrics.org'<BR><B>Subject:</B> RE: NvmeStartio path critical
section handling not protected from NVMe ISR?<o:p></o:p></SPAN></P></DIV></DIV>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt">I
just thought of another way to handle this problem.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt">Could
we not call <B>StorPortSynchronizeAccess() </B>with a pointer back to our
ProcessIo() routine?<B> </B>ProcessIo would get called before the call to
StorPortSynchronizeAccess() returns and this would have the effect of
guaranteeing synchronization with our ISR.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt">This
seems like a much cleaner solution that a lock-acquiring approach.
<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt">I
still don’t know if there are any issues with ProcessIo being called multiple
times, from non-StartIo code paths, etc. – would still need to be looked
at.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt">Thanks,<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt">Judy<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt"><o:p> </o:p></SPAN></P>
<DIV>
<DIV
style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<P class=MsoNormal><B><SPAN
style="FONT-FAMILY: 'Tahoma','sans-serif'; FONT-SIZE: 10pt">From:</SPAN></B><SPAN
style="FONT-FAMILY: 'Tahoma','sans-serif'; FONT-SIZE: 10pt"> Judy Brock-SSI
<BR><B>Sent:</B> Wednesday, July 17, 2013 10:08 PM<BR><B>To:</B> <A
href="mailto:nvmewin@lists.openfabrics.org">nvmewin@lists.openfabrics.org</A><BR><B>Subject:</B>
NvmeStartio path critical section handling not protected from NVMe
ISR?<o:p></o:p></SPAN></P></DIV></DIV>
<P class=MsoNormal><o:p> </o:p></P>
<DIV>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt">All,
<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: black; FONT-SIZE: 11pt">Under
Windows Server 2012, I’ve seen a crash where NVMeStartIo() gets
interrupted by our ISR at a time when it’s in the middle of manipulating a
linked list critical data structure which the ISR then goes on to attempt to
manipulate also - which results in a crash. Below is the call stack – see
where I’ve inserted the comment</SPAN><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt"> “</SPAN><B><SPAN
style="FONT-FAMILY: Wingdings; COLOR: red; FONT-SIZE: 9pt">ß</SPAN></B><B><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: red; FONT-SIZE: 9pt">-STARTIO
PATH GETS CLOBBERED BY OUR INTERRUPT HANDLER BECAUSE WE AREN’T HOLDING THE
INTERRUPT SPIN LOCK”<o:p></o:p></SPAN></B></P>
<P class=MsoNormal><B><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: red; FONT-SIZE: 9pt"><o:p> </o:p></SPAN></B></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">2:
kd> kc<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">Call
Site<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">nt!RtlpBreakWithStatusInstruction<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">nt!KiBugCheckDebugBreak<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">nt!KeBugCheck2<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">nt!KeBugCheckEx<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">nt!KiBugCheckDispatch<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">nt!KiFastFailDispatch<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">nt!KiRaiseSecurityCheckFailure<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">nvme!RtlFailFast<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">nvme!FatalListEntryError<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">nvme!RtlpCheckListEntry<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">nvme!InsertTailList<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">nvme!NVMeCompleteCmd<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">nvme!NVMeIsrMsix<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">nt!KiInterruptDispatch
</SPAN><B><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: red; FONT-SIZE: 9pt"> </SPAN></B><B><SPAN
style="FONT-FAMILY: Wingdings; COLOR: red; FONT-SIZE: 9pt">ß</SPAN></B><B><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: red; FONT-SIZE: 9pt">-STARTIO
PATH GETS CLOBBERED BY OUR INTERRUPT HANDLER BECAUSE WE AREN’T HOLDING THE
INTERRUPT SPIN LOCK<o:p></o:p></SPAN></B></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">nvme!RemoveHeadList<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">nvme!NVMeGetCmdEntry<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">nvme!ProcessIo<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">nvme!NVMeStartIo<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">storport!RaidpAdapterContinueScatterGather<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">hal!HalpAllocateAdapterCallbackV2<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">hal!IoFreeAdapterChannelV2<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">hal!HalAllocateAdapterChannelV2<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">hal!HalBuildScatterGatherListV2<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">storport!RaUnitStartIo<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">storport!RaidUnitCompleteRequest<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">storport!RaidpAdapterRedirectDpcRoutine<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">nt!KiExecuteAllDpcs<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 9pt">nt!KiRetireDpcList</SPAN><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal><B><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: red; FONT-SIZE: 9pt"><o:p> </o:p></SPAN></B></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: black; FONT-SIZE: 11pt">I
looked through the code and noticed we never call StorPortAcquireSpinLock to
acquire the InterruptLock to protect us from such pre-emption. Another way to
achieve this would be to indicate we run at half-duplex rather than
full-duplex but that would degrade the general performance of the driver.
<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: black; FONT-SIZE: 11pt"> <o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: black; FONT-SIZE: 11pt">I’m
not sure why we didn’t run into this way before now – is there some other
re-entrance protection algorithm besides the two above that others are aware of?
If not, I believe we need to fix this asap.
Suggestions:<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt"><o:p> </o:p></SPAN></P>
<P style="TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2"
class=MsoListParagraph><![if !supportLists]><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: black; FONT-SIZE: 11pt"><SPAN
style="mso-list: Ignore">A.<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN></SPAN><![endif]><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: black; FONT-SIZE: 11pt">Simplest
approach is to lock down all of NVMeStartIo as per below (not tested yet) but we
almost may as well run half-duplex if we do this:<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: black; FONT-SIZE: 9pt"><o:p> </o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: black; FONT-SIZE: 9pt">1 . At
the very the top of NVMeStartIo:<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: black; FONT-SIZE: 9pt"><o:p> </o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: green; FONT-SIZE: 9pt">/* we should
never be holding the interrupt lock upon entry to
NVMeStartIo.<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: green; FONT-SIZE: 9pt">
* Acquire the Interrupt Spin Lock to protect against getting hit by our ISR.
<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: green; FONT-SIZE: 9pt">
*/<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">
<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">
<SPAN style="COLOR: blue">if</SPAN> (NULL ==
pAdapterExtension->hInterruptLock) {<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">
(StorPortAcquireSpinLock(pAdapterExtension,<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">
InterruptLock,<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">
NULL,<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">
&pAdapterExtension->hInterruptLock);<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">
}<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">
<SPAN style="COLOR: blue">else</SPAN> {<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">
ASSERT(FALSE);<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">
}<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt"><o:p> </o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">2. </SPAN><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: black; FONT-SIZE: 9pt">At the
very the top of </SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">IO_StorPortNotification</SPAN><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: black; FONT-SIZE: 9pt"><o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt"><o:p> </o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">
PNVME_DEVICE_EXTENSION pAE = (PNVME_DEVICE_EXTENSION)
pHwDeviceExtension;<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt"><o:p> </o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt"> <SPAN
style="COLOR: green">/* if we got here from NvmeStartIo we need to release the
interrupt lock */<o:p></o:p></SPAN></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">
<SPAN style="COLOR: blue">if</SPAN> (NULL != pAE->hInterruptLock)
{<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">
STOR_LOCK_HANDLE hInterruptLockCopy =
pAE->hInterruptLock;<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">
pAE->hInterruptLock = NULL;<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">
StorPortReleaseSpinLock(pAE, &hInterruptLockCopy);<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">
}<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt"><o:p> </o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt"><o:p> </o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">3. At the very bottom of
NVMeStartIo:<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">
<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">
<SPAN style="COLOR: green">/* if we didn't release the Interrupt Lock in one of
the calls to <o:p></o:p></SPAN></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: green; FONT-SIZE: 9pt">
* IO_StorPortNotification above we need to release before we exit
NVMEStartIo<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: green; FONT-SIZE: 9pt">
*/<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: green; FONT-SIZE: 9pt"><o:p> </o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">
<SPAN style="COLOR: blue">if</SPAN> (NULL != pAE->hInterruptLock)
{<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">
STOR_LOCK_HANDLE hInterruptLockCopy =
pAE->hInterruptLock;<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">
pAE->hInterruptLock = NULL;<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">
StorPortReleaseSpinLock(pAE,
&hInterruptLockCopy);<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">
}<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt"><o:p> </o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt"> <SPAN
style="COLOR: blue">return</SPAN> TRUE;<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt">} <SPAN
style="COLOR: green">/* NVMeStartIo */</SPAN></SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: green; FONT-SIZE: 10pt"><o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: green; FONT-SIZE: 10pt"><o:p> </o:p></SPAN></P>
<P style="TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2"
class=MsoListParagraph><![if !supportLists]><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: black; FONT-SIZE: 11pt"><SPAN
style="mso-list: Ignore">B.<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN></SPAN><![endif]><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: black; FONT-SIZE: 11pt">Better
approach is to just lock ProcessIo(). But code exists in that routine
which acquires the StartIo lock – we can’t take locks out of order or we’ll
cause deadlock. Right now that code never gets invoked – what was it for?
Do we still need it? Can ProcessIo() get called from non-StartIo Paths? Can it
get called multiple times? Not having been involved in the initial development
of this driver, I would need to study the flow to make sure to respect the
StorPort lock acquiring/releasing hierarchy rules at all times. If those
conversant in the overall developmental history and architecture of this driver
could share their thoughts, that would be great.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: black; FONT-SIZE: 11pt"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: black; FONT-SIZE: 11pt">Thanks,<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: black; FONT-SIZE: 11pt"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: black; FONT-SIZE: 11pt">Judy<o:p></o:p></SPAN></P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt"><o:p> </o:p></SPAN></P></DIV></DIV></BODY></HTML>