<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=us-ascii"><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:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-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.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";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
p.Default, li.Default, div.Default
        {mso-style-name:Default;
        margin:0in;
        margin-bottom:.0001pt;
        text-autospace:none;
        font-size:12.0pt;
        font-family:"Arial","sans-serif";
        color:black;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
span.EmailStyle22
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
span.EmailStyle23
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
span.EmailStyle24
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
span.EmailStyle25
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
span.EmailStyle26
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
span.EmailStyle27
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle28
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
span.EmailStyle29
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle30
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:619529188;
        mso-list-type:hybrid;
        mso-list-template-ids:-176114058 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1
        {mso-list-id:623076956;
        mso-list-type:hybrid;
        mso-list-template-ids:1581259952 523287856 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l1:level1
        {mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Calibri","sans-serif";
        mso-fareast-font-family:Calibri;}
@list l1:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l1:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l1:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l1:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l1:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l1:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l1:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l1:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
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 class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>BTW, here’s what the spec says for CC.EN<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:black'>When this field is set to ‘1’, the controller sets CSTS.RDY to ‘1’ when it is ready to process commands. <o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>I read it as “set CC.EN to 1 after setting up the admin-queues, otherwise RDY will *<b>not</b>* be 1”<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><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"'> Rajagopalan, Karthik <br><b>Sent:</b> Wednesday, August 15, 2012 6:32 PM<br><b>To:</b> 'Luse, Paul E'; Verma, Vishal L; Alex.Chang@idt.com; nvmewin@lists.openfabrics.org<br><b>Subject:</b> RE: [nvmewin] patch review status<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='color:#1F497D'>Yep </span><span style='font-family:Wingdings;color:#1F497D'>J</span><span style='color:#1F497D'> but I think it doesn’t have to be so – all we need to do is an unconditional (attempt) to reset.. we don’t set CC.EN to 1 until we’re ready to enable the controller.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Here are the possibilities when we try to reset:<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='color:#1F497D'><span style='mso-list:Ignore'>1.<span style='font:7.0pt "Times New Roman"'>       </span></span></span><![endif]><span style='color:#1F497D'>CC.EN is 0 to begin with => no need to reset; but setting it again to 0 should be a NOP<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='color:#1F497D'><span style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'>       </span></span></span><![endif]><span style='color:#1F497D'>CC.EN is 1 to begin with => need to reset; we didn’t wiggle this yet, so STS.RDY should be 1; setting EN to 0 will actually reset<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:1.0in;text-indent:-.25in;mso-list:l0 level2 lfo2'><![if !supportLists]><span style='color:#1F497D'><span style='mso-list:Ignore'>a.<span style='font:7.0pt "Times New Roman"'>       </span></span></span><![endif]><span style='color:#1F497D'>The original issue you mention could still happen if STS.RDY stayed 0 (bad controller IMHO); still goodness in trying to reset<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Here’s a patch in case you want to try this approach… <o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><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"'> Luse, Paul E [mailto:paul.e.luse@intel.com] <br><b>Sent:</b> Wednesday, August 15, 2012 6:22 PM<br><b>To:</b> Rajagopalan, Karthik; Verma, Vishal L; Alex.Chang@idt.com; nvmewin@lists.openfabrics.org<br><b>Subject:</b> RE: [nvmewin] patch review status<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>0 doesn’t reset unless it was previously 1… that’s why the initial implementation set it to 1, then 0 to force reset then init happened.  The question came in about setting it to 0 right after setting it to 1, anytime you transition to 1 you need to wait for RDY so the code I proposed last will always reset but only for a 2<sup>nd</sup> wait on RDY (there’s one after we enable as part of init) if the controller wasn’t disabled when we started.  Hard to believe something so simple can be so convoluted isn’t it?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><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"'> Karthik_Rajagopalan@Dell.com [mailto:Karthik_Rajagopalan@Dell.com] <br><b>Sent:</b> Wednesday, August 15, 2012 4:11 PM<br><b>To:</b> Luse, Paul E; Verma, Vishal L; Alex.Chang@idt.com; nvmewin@lists.openfabrics.org<br><b>Subject:</b> RE: [nvmewin] patch review status<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='color:#1F497D'>Why not unconditionally set CC.EN to 0 as soon as the driver loads ?<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l1 level1 lfo4'><![if !supportLists]><span style='color:#1F497D'><span style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>          </span></span></span><![endif]><span style='color:#1F497D'>There will be an issue with this iff someone before (opROM, UEFI ?) had set CC.EN to 1 & somehow STS.RDY never went to 1… but things still continued (unlikely)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>i.e., <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>    /* Disable / Reset */</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>    CC.EN = 0;</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>    StorPortWriteRegisterUlong(pAE,</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>                               (PULONG)(&pAE->pCtrlRegister->CC),</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>                               CC.AsUlong);<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>    /* Set EN to 1 (all others zero) */</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>    CC.EN = 1;</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>    StorPortWriteRegisterUlong(pAE,</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>                               (PULONG)(&pAE->pCtrlRegister->CC),</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>                               CC.AsUlong);<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>   /* Wait for RDY */<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><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"'> <a href="mailto:nvmewin-bounces@lists.openfabrics.org">nvmewin-bounces@lists.openfabrics.org</a> <a href="mailto:[mailto:nvmewin-bounces@lists.openfabrics.org]">[mailto:nvmewin-bounces@lists.openfabrics.org]</a> <b>On Behalf Of </b>Luse, Paul E<br><b>Sent:</b> Wednesday, August 15, 2012 5:59 PM<br><b>To:</b> Verma, Vishal L; Chang, Alex; <a href="mailto:nvmewin@lists.openfabrics.org">nvmewin@lists.openfabrics.org</a><br><b>Subject:</b> Re: [nvmewin] patch review status<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>So maybe a better proposal for this section of code… go back to what we had before (sorta) but include a wait on RDY after setting EN to 1 and only set EN to 1 if its zero to start.  This is the most generic soln and since the behavior of the HW at this detailed level isn’t specified we can call this the least common denominator and if IHVs want to optimize for their implementations they can.  If this first RDY wait files, then we fail driver init.  This code assures we always reset and we never touch EN after setting it to 1 without waiting for RDY<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D;background:yellow;mso-highlight:yellow'>IF EN == 0 {</span><span style='font-size:10.0pt;color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>    /* Set EN to 1 (all others zero) */</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>    CC.EN = 1;</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>    StorPortWriteRegisterUlong(pAE,</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>                               (PULONG)(&pAE->pCtrlRegister->CC),</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>                               CC.AsUlong);<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D;background:yellow;mso-highlight:yellow'>WAIT ON RDY<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D;background:yellow;mso-highlight:yellow'>}</span><span style='font-size:10.0pt;color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>    /* Now reset */</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>    CC.EN = 0;</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>    StorPortWriteRegisterUlong(pAE,</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>                               (PULONG)(&pAE->pCtrlRegister->CC),</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>                               CC.AsUlong);</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><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"'> Luse, Paul E <br><b>Sent:</b> Wednesday, August 15, 2012 3:21 PM<br><b>To:</b> Verma, Vishal L; Chang, Alex; <a href="mailto:nvmewin@lists.openfabrics.org">nvmewin@lists.openfabrics.org</a><br><b>Subject:</b> RE: [nvmewin] patch review status<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>I was thinking about that too… If EN was already 1 and we caught RDY before it was 0 then we would indeed set EN to 1 again (possibly before, during or after RDY is set).  The spec, of course, does not dictate behavior in this case but one would assume it would be treated as a NOP and our init state machine would properly wait for RDY.  I’m not a HW guy though, anyone else have a comment/concern on setting EN to 1 if tis already 1?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><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"'> Verma, Vishal L <br><b>Sent:</b> Wednesday, August 15, 2012 1:46 PM<br><b>To:</b> Luse, Paul E; Chang, Alex; <a href="mailto:nvmewin@lists.openfabrics.org">nvmewin@lists.openfabrics.org</a><br><b>Subject:</b> Re: [nvmewin] patch review status<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal><span style='font-size:10.5pt;color:black'>Paul,<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;color:black'>Is this correct though?<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;color:black'>Making CC.EN 0 implies that RDY will  become 0, but RDY being 0 does not guarantee that CC.EN is 0.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;color:black'>If what I'm thinking is right, we could be in a state where CC.EN was 1 when the driver comes up, but the controller never became ready. In this case we will think everything is alright, and we will try to make CC.EN 1 again – Which is not something we'd want to do, right?<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;color:black'>Vishal<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;color:black'><o:p> </o:p></span></p></div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='color:black'>From: </span></b><span style='color:black'><Luse>, Paul E <<a href="mailto:paul.e.luse@intel.com">paul.e.luse@intel.com</a>><br><b>Date: </b>Wednesday, August 15, 2012 11:43 AM<br><b>To: </b>"Chang, Alex" <<a href="mailto:Alex.Chang@idt.com">Alex.Chang@idt.com</a>>, "<a href="mailto:nvmewin@lists.openfabrics.org">nvmewin@lists.openfabrics.org</a>" <<a href="mailto:nvmewin@lists.openfabrics.org">nvmewin@lists.openfabrics.org</a>><br><b>Subject: </b>Re: [nvmewin] patch review status<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;color:black'><o:p> </o:p></span></p></div><div><div><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>OK, I think I can get behind that.  I was thinking STS might not be valid when EN is 0 but looking at the spec I think this is fine</span><span style='color:black'><o:p></o:p></span></p><p class=Default><b><span style='font-size:9.0pt'>Ready (RDY): </span></b><span style='font-size:9.0pt'>This field is set to ‘1’ when the controller is ready to process commands after CC.EN is set to ‘1’. This field shall be cleared to ‘0’ when CC.EN is cleared to ‘0’. Commands shall not be issued to the controller until this field is set to ‘1’ after the CC.EN bit is set to ‘1’. Failure to follow this requirement produces undefined results. Host software shall wait a minimum of CAP.TO seconds for this field to be set to ‘1’ after setting CC.EN to ‘1’ from a previous value of ‘0’. </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>So I’ll just chance the check below for EN == 1 to RDY == 1 then</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>Thanks!</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>Paul</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'> </span><span style='color:black'><o:p></o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black'> Chang, Alex [<a href="mailto:Alex.Chang@idt.com">mailto:Alex.Chang@idt.com</a>] <br><b>Sent:</b> Wednesday, August 15, 2012 10:21 AM<br><b>To:</b> Luse, Paul E; <a href="mailto:nvmewin@lists.openfabrics.org">nvmewin@lists.openfabrics.org</a><br><b>Subject:</b> RE: patch review status</span><span style='color:black'><o:p></o:p></span></p></div></div><p class=MsoNormal><span style='color:black'> </span><span style='font-size:10.0pt;color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:blue'>Absolutely. Now, the tricky part is when CC.EN=1 and STS.RDY never becomes 1. I'd say simply check STS.RDY only. If it's 1, then reset the device, otherwise, skip resetting it. What do you think?</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif";color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:blue'>Thanks,</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:blue'>Alex</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif";color:black'> </span><span style='color:black'><o:p></o:p></span></p><div class=MsoNormal align=center style='text-align:center'><span style='font-size:12.0pt;font-family:"Times New Roman","serif";color:black'><hr size=3 width="100%" align=center></span></div><p class=MsoNormal style='margin-bottom:12.0pt'><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black'> Luse, Paul E <a href="mailto:[mailto:paul.e.luse@intel.com]">[mailto:paul.e.luse@intel.com]</a><br><b>Sent:</b> Wednesday, August 15, 2012 9:56 AM<br><b>To:</b> Chang, Alex; <a href="mailto:nvmewin@lists.openfabrics.org">nvmewin@lists.openfabrics.org</a><br><b>Subject:</b> RE: patch review status</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>OK, I see what you’re saying I think.   We don’t want to check for RDY without first looking at EN so does this make sense:</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>    if (CC.EN == 1) {</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>                <span style='background:yellow;mso-highlight:yellow'>-- now wait for RDY -</span></span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>        /* Now reset */</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>        CC.EN = 0;</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>        StorPortWriteRegisterUlong(pAE,</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>                               (PULONG)(&pAE->pCtrlRegister->CC),</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>                               CC.AsUlong);</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>    }</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'> </span><span style='color:black'><o:p></o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black'> Chang, Alex <a href="mailto:[mailto:Alex.Chang@idt.com]">[mailto:Alex.Chang@idt.com]</a><br><b>Sent:</b> Wednesday, August 15, 2012 9:52 AM<br><b>To:</b> Luse, Paul E; <a href="mailto:nvmewin@lists.openfabrics.org">nvmewin@lists.openfabrics.org</a><br><b>Subject:</b> RE: patch review status</span><span style='color:black'><o:p></o:p></span></p></div></div><p class=MsoNormal><span style='color:black'> </span><span style='font-size:10.0pt;color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:blue'>Hi Paul,</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif";color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:blue'>I agree with the new logic on #3. However, instead of checking CC.EN, should we check STS.RDY or both?</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif";color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:blue'>Thanks,<br>Alex</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif";color:black'> </span><span style='color:black'><o:p></o:p></span></p><div class=MsoNormal align=center style='text-align:center'><span style='font-size:12.0pt;font-family:"Times New Roman","serif";color:black'><hr size=3 width="100%" align=center></span></div><p class=MsoNormal style='margin-bottom:12.0pt'><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black'> Luse, Paul E <a href="mailto:[mailto:paul.e.luse@intel.com]">[mailto:paul.e.luse@intel.com]</a><br><b>Sent:</b> Wednesday, August 15, 2012 9:03 AM<br><b>To:</b> Chang, Alex; <a href="mailto:nvmewin@lists.openfabrics.org">nvmewin@lists.openfabrics.org</a><br><b>Subject:</b> RE: patch review status</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#984807'>Thanks Alex, see below.</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'> </span><span style='color:black'><o:p></o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black'> Chang, Alex <a href="mailto:[mailto:Alex.Chang@idt.com]">[mailto:Alex.Chang@idt.com]</a><br><b>Sent:</b> Wednesday, August 15, 2012 8:51 AM<br><b>To:</b> Luse, Paul E; <a href="mailto:nvmewin@lists.openfabrics.org">nvmewin@lists.openfabrics.org</a><br><b>Subject:</b> RE: patch review status</span><span style='color:black'><o:p></o:p></span></p></div></div><p class=MsoNormal><span style='color:black'> </span><span style='font-size:10.0pt;color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:blue'>Hi Paul,</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif";color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:blue'>Some questions after browsing the difference between current source and your changes:</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:blue'>1. Why you removed "CC.SHN  = 1;" in NVMeNormalShutdown routine?</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#984807'>PL>  Good eye, that was a mistake.  I’ll add it back before pushing</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif";color:#1F497D'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:blue'>2. In nvme.h, why you changed the opcode of NVM_DATASET_MANAGEMENT from 0x06 to 0x09?</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#984807'>PL>    6 was wrong, 9 is correct per spec</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:blue'>3. Is there any specific reason(s), you added the following in NVMeInitialize, and then immediately clear EN without checking RDY = 1?</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:blue'>    /* Set EN to 1 (all others zero) */<br>    CC.EN = 1;<br>    StorPortWriteRegisterUlong(pAE,<br>                               (PULONG)(&pAE->pCtrlRegister->CC),<br>                               CC.AsUlong);</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#984807'>PL>    I wrote this up in the patch submission and I can’t find that email right now.  I didn’t add code, I changed code.  Before, we use to set EN to 1, read it back, and then set it to 0 to kick off a reset and then later we wait for RDY in the init state machine.  We had an IHV complain that their implementation required waiting on RDY after setting EN 1 to even before clearing EN.  So, our old implementation was a problem.  So what I did now is to not force a reset unless EN is set to 1 when we come in.  If its set to 0 then either (a) we’re coming from power on or (b) the pre_OS reset the card when it was done.  Either way if its already 0 then we’re in a known state so we do nothing and then later we set to 1 and wait on RDY.  If its 1 when we enter here we set to 0 and then later set to 1 and wait on RDY.  Make sense?  This assures we never enable without waiting for RDY</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>***** WAS *******</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>    /* Set EN to 1 (all others zero) */</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>    CC.EN = 1;</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>    StorPortWriteRegisterUlong(pAE,</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>                               (PULONG)(&pAE->pCtrlRegister->CC),</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>                               CC.AsUlong);</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>    /* Read it back */</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>    CC.AsUlong =</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>        StorPortReadRegisterUlong(pAE, (PULONG)(&pAE->pCtrlRegister->CC));</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>    /* Now reset */</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>    CC.EN = 0;</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>    StorPortWriteRegisterUlong(pAE,</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>                               (PULONG)(&pAE->pCtrlRegister->CC),</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>                               CC.AsUlong);</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>    CC.AsUlong =</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>        StorPortReadRegisterUlong(pAE, (PULONG)(&pAE->pCtrlRegister->CC));</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>*** NOW IS *******</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>    if (CC.EN == 1) {</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>        /* Now reset */</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>        CC.EN = 0;</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>        StorPortWriteRegisterUlong(pAE,</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>                               (PULONG)(&pAE->pCtrlRegister->CC),</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>                               CC.AsUlong);</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'>    }</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:#1F497D'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:blue'>Thanks,</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:blue'>Alex</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif";color:black'> </span><span style='color:black'><o:p></o:p></span></p><div class=MsoNormal align=center style='text-align:center'><span style='font-size:12.0pt;font-family:"Times New Roman","serif";color:black'><hr size=3 width="100%" align=center></span></div><p class=MsoNormal style='margin-bottom:12.0pt'><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black'><a href="mailto:nvmewin-bounces@lists.openfabrics.org">nvmewin-bounces@lists.openfabrics.org</a><a href="mailto:[mailto:nvmewin-bounces@lists.openfabrics.org]">[mailto:nvmewin-bounces@lists.openfabrics.org]</a><b>On Behalf Of </b>Luse, Paul E<br><b>Sent:</b> Wednesday, August 15, 2012 8:12 AM<br><b>To:</b> <a href="mailto:nvmewin@lists.openfabrics.org">nvmewin@lists.openfabrics.org</a><br><b>Subject:</b> [nvmewin] patch review status</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:black'>Just checking in… any questions to date and how are folks tracking for completing their review by this Fri?</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:black'>Thx</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:black'>Paul</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black'>____________________________________</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black'>Paul Luse<br>Sr. Staff Engineer<br>PCG Server Software Engineering <br>Desk: 480.554.3688, Mobile: 480.334.4630</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='color:black'> </span><span style='font-size:10.0pt;color:black'><o:p></o:p></span></p></div></div></div></body></html>