<html 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" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle23
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></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 class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi Alex, we approve the patch as well.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Carolyn<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> nvmewin-bounces@lists.openfabrics.org [mailto:nvmewin-bounces@lists.openfabrics.org]
<b>On Behalf Of </b>Parag Sheth<br>
<b>Sent:</b> Monday, November 17, 2014 12:45 PM<br>
<b>To:</b> Alex Chang<br>
<b>Cc:</b> nvmewin@lists.openfabrics.org; suman.p@samsung.com<br>
<b>Subject:</b> Re: [nvmewin] Samsung patch for Hot plug fixes<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Hi Alex,<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">These changes look good. we approve the patch.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Parag Sheth<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Mon, Nov 17, 2014 at 8:21 AM, Alex Chang <<a href="mailto:Alex.Chang@pmcs.com" target="_blank">Alex.Chang@pmcs.com</a>> wrote:<o:p></o:p></p>
<div style="margin-left:7.5pt;margin-top:7.5pt;margin-right:7.5pt;margin-bottom:7.5pt">
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Dear all,</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Please review/test the revised patch and provide your feedback. I will start to collect approvals
 on Thursday.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks,</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Alex</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> SUMAN PRAKASH B [mailto:<a href="mailto:suman.p@samsung.com" target="_blank">suman.p@samsung.com</a>]
<br>
<b>Sent:</b> Monday, November 17, 2014 1:17 AM<br>
<b>To:</b> <a href="mailto:nvmewin@lists.openfabrics.org" target="_blank">nvmewin@lists.openfabrics.org</a>; Alex Chang;
<a href="mailto:parag.sheth@seagate.com" target="_blank">parag.sheth@seagate.com</a>;
<a href="mailto:judy.brock@ssi.samsung.com" target="_blank">judy.brock@ssi.samsung.com</a><br>
<b>Subject:</b> RE: Re: [nvmewin] Samsung patch for Hot plug fixes</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<pre>Content-Type: text/plain; charset=UTF-8<o:p></o:p></pre>
<pre>Content-Transfer-Encoding: 8bit<o:p></o:p></pre>
<pre>Date: %%SENT_DATE%%<o:p></o:p></pre>
<pre>Subject: Suspect Message Quarantined <o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>WARNING: The virus scanner was unable to scan an attachment in an email message sent to you.  This attachment could possibly contain viruses or other malicious programs.  The attachment could not be scanned for the following reasons:<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>%%DESC%%<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>The full message and the attachment have been stored in the quarantine.<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>The identifier for this message is '%%QID%%'.<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>Access the quarantine at: <o:p></o:p></pre>
<pre><a href="https://puremessage.pmc-sierra.bc.ca:28443/" target="_blank">https://puremessage.pmc-sierra.bc.ca:28443/</a><o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>For more information on PMC's Anti-Spam system:<o:p></o:p></pre>
<pre><a href="http://pmc-intranet/wiki/index.php/Outlook:Anti-Spam_FAQ" target="_blank">http://pmc-intranet/wiki/index.php/Outlook:Anti-Spam_FAQ</a><o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>IT Services<o:p></o:p></pre>
<pre>PureMessage Admin <o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<p><span style="font-family:"Calibri","sans-serif";color:#1F497D">Hi Alex,</span><o:p></o:p></p>
<p> <o:p></o:p></p>
<p><span style="font-family:"Calibri","sans-serif";color:#1F497D">Please find attached the revised code with the following review comments incorporated. Password is
</span><strong><span style="font-family:"Calibri","sans-serif";color:blue">samsung123</span></strong><span style="font-family:"Calibri","sans-serif";color:#1F497D">.</span><o:p></o:p></p>
<p> <o:p></o:p></p>
<p>1. In function NVMeWaitForCtrlRDY(), you return TRUE when device is removed. And as per your explanation, this is to avoid delay in removing device from device manager. But returning TRUE is not intuitive. This function actually failed and hence we should
 be returning FALSE. And if this breaks your flow than the max delay would be 500 milliseconds. I would say that is negligible from user display point of view.<o:p></o:p></p>
<p><span style="font-family:"Calibri","sans-serif";color:#1F497D">a. Moved the pAE->ShutdownInProgress inside the else part in NVMeAdapterControlPowerDown().<br>
b. Returned FALSE from NVMeWaitForCtrlRDY() when device is removed.</span><o:p></o:p></p>
<p> <o:p></o:p></p>
<p><span style="color:black">2. Function brief needs to be updated for NVMeDetectPendingCmds() for the 3rd parameter.</span><span style="font-family:"Calibri","sans-serif";color:#1F497D"><br>
Function brief updated for NVMeDetectPendingCmds() for the 3rd parameter.</span><o:p></o:p></p>
<p> <o:p></o:p></p>
<p><span style="font-family:"Calibri","sans-serif";color:#1F497D">Thanks,</span><o:p></o:p></p>
<p><span style="font-family:"Calibri","sans-serif";color:#1F497D">Suman</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;font-family:"Arial","sans-serif""> </span><o:p></o:p></p>
<p>------- <b>Original Message</b> -------<o:p></o:p></p>
<p><b>Sender</b> : Alex Chang<<a href="mailto:Alex.Chang@pmcs.com" target="_blank">Alex.Chang@pmcs.com</a>><o:p></o:p></p>
<p><b>Date</b> : Nov 15, 2014 03:36 (GMT+05:00)<o:p></o:p></p>
<p><b>Title</b> : RE: Re: [nvmewin] Samsung patch for Hot plug fixes<o:p></o:p></p>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi Suman,</span><o:p></o:p></p>
<p style="margin-bottom:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p style="margin-bottom:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Could you please revise the codes, test and send it out at your earliest convenience?</span><o:p></o:p></p>
<p style="margin-bottom:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p style="margin-bottom:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thank you!</span><o:p></o:p></p>
<p style="margin-bottom:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Alex</span><o:p></o:p></p>
<p style="margin-bottom:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p style="margin-bottom:0in;margin-bottom:.0001pt"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Parag Sheth [mailto:<a href="mailto:parag.sheth@seagate.com" target="_blank">parag.sheth@seagate.com</a>]
<br>
<b>Sent:</b> Friday, November 14, 2014 1:56 PM<br>
<b>To:</b> <a href="mailto:suman.p@samsung.com" target="_blank">suman.p@samsung.com</a><br>
<b>Cc:</b> Alex Chang; <a href="mailto:nvmewin@lists.openfabrics.org" target="_blank">
nvmewin@lists.openfabrics.org</a>; <a href="mailto:judy.brock@ssi.samsung.com" target="_blank">
judy.brock@ssi.samsung.com</a><br>
<b>Subject:</b> Re: Re: [nvmewin] Samsung patch for Hot plug fixes</span><o:p></o:p></p>
<p style="margin-bottom:0in;margin-bottom:.0001pt"> <o:p></o:p></p>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt">Hi Suman,<o:p></o:p></p>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt"> <o:p></o:p></p>
</div>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt">As long as this change passes all your test cases - I am ok with that.<o:p></o:p></p>
</div>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt"> <o:p></o:p></p>
</div>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt">Thanks<o:p></o:p></p>
</div>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt">Parag Sheth<o:p></o:p></p>
</div>
</div>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt"> <o:p></o:p></p>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt">On Fri, Nov 14, 2014 at 12:40 AM, SUMAN PRAKASH B <<a href="mailto:suman.p@samsung.com" target="_blank">suman.p@samsung.com</a>> wrote:<o:p></o:p></p>
<div>
<p>Hi Parag,<o:p></o:p></p>
<p> <o:p></o:p></p>
<p>Thanks for your feedback. Please find my comments inline.<o:p></o:p></p>
<p> <o:p></o:p></p>
<p>Thanks,<o:p></o:p></p>
<p>Suman<o:p></o:p></p>
<p> <o:p></o:p></p>
<p>------- <b>Original Message</b> -------<o:p></o:p></p>
<p><b>Sender</b> : Parag Sheth<<a href="mailto:parag.sheth@seagate.com" target="_blank">parag.sheth@seagate.com</a>><o:p></o:p></p>
<p><b>Date</b> : Nov 14, 2014 06:31 (GMT+05:00)<o:p></o:p></p>
<p><b>Title</b> : Re: [nvmewin] Samsung patch for Hot plug fixes<o:p></o:p></p>
<p> <o:p></o:p></p>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt">Hi Suman, <o:p></o:p></p>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt"> <o:p></o:p></p>
</div>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt">Here are my observations<o:p></o:p></p>
</div>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt"> <o:p></o:p></p>
</div>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt">1. In function NVMeWaitForCtrlRDY(), you return TRUE when device is removed. And as per your explanation, this is to avoid delay in removing device from device manager. But returning TRUE is not intuitive.
 This function actually failed and hence we should be returning FALSE. And if this breaks your flow than the max delay would be 500 milliseconds. I would say that is negligible from user display point of view.<o:p></o:p></p>
</div>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt"><strong><span style="color:blue">[Suman]
</span></strong><span style="color:blue">Agreed. We initially returned FALSE from NVMeWaitForCtrlRDY() when device is removed. We changed it to TRUE for the following reason.</span><o:p></o:p></p>
</div>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt"><span style="color:blue">When device is removed, the NVMeBuildIo() -> SRB_FUNCTION_PNP -> NVMeAdapterControlPowerDown() -> NVMeResetAdapter() -> NVMeWaitForCtrlRDY() was returning FALSE because of which the
 pAE->ShutdownInProgess was not set to TRUE in NVMeAdaptercontrolPowerDown. <br>
After this when NVMeAdapterControl() -> ScsiStopAdapter -> NVMeAdapterControlPowerDown() is invoked, since the pAE->ShutdownInProgess was not set to TRUE in NVMeBuildIo(), the NVMeDetectPendingCmds() and NVMeResetAdapter() is executed again. This should not
 be executed second time.<br>
To avoid this we retured TRUE from NVMeWaitForCtrlRDY() so that pAE->ShutdownInProgress is set to TRUE.</span><o:p></o:p></p>
</div>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt"> <o:p></o:p></p>
</div>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt"><span style="color:blue">To resolve this, in NVMeAdapterControlPowerDown(), we can move setting the pAE->ShutdownInProgress inside the else part and return FALSE when device is removed from NVMeWaitForCtrlRDY()
 as follows.</span><o:p></o:p></p>
</div>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt"><span style="color:blue">NVMeAdapterControlPowerDown()<br>
{<br>
...<br>
    if (pAE->ShutdownInProgress == TRUE) {<br>
        /* Shutdown */<br>
        status = TRUE;<br>
    } else {<br>
        <span style="background:yellow">pAE->ShutdownInProgress = TRUE;</span></span><o:p></o:p></p>
</div>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt"><span style="color:blue">        /* Hibernate or Sleep - sanity check that there is no cmd pending */<br>
        if (NVMeDetectPendingCmds(pAE, FALSE, SRB_STATUS_BUS_RESET) == TRUE)<br>
            return status;</span><o:p></o:p></p>
</div>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt"><span style="color:blue">        /* Stop the controller, but do not free the resources */<br>
        if (NVMeResetAdapter(pAE) != TRUE) {<br>
            return (FALSE);<br>
        }<br>
    }<br>
...<br>
}</span><o:p></o:p></p>
</div>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt"><span style="color:blue">Kindly let us know your opinion.</span><o:p></o:p></p>
</div>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt"><br>
 <o:p></o:p></p>
</div>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt">2. Function brief needs to be updated for NVMeDetectPendingCmds() for the 3rd parameter.<o:p></o:p></p>
</div>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt"><strong><span style="color:blue">[Suman]
</span></strong><span style="color:blue">Yes. We will change this.</span><o:p></o:p></p>
</div>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt"><br>
 <o:p></o:p></p>
</div>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt">Other than these 2, your changes look good.<o:p></o:p></p>
</div>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt"> <o:p></o:p></p>
</div>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt">Thanks<o:p></o:p></p>
</div>
<div>
<p style="margin-bottom:0in;margin-bottom:.0001pt">Parag Sheth<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
<p> <o:p></o:p></p>
<table class="MsoNormalTable" border="0" cellpadding="0">
<tbody>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p><img border="0" width="520" height="144" id="_x0000_i1025" src="cid:image001.gif@01D00266.7602F750"><o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="border:solid windowtext 1.0pt;padding:0in"><img border="0" width="100" height="100" id="_x0000_i1026" src="cid:image002.jpg@01D00266.7602F750" alt="Image removed by sender."></span><o:p></o:p></p>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>