<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Yeah, that came to my mind as well.<br>
      <br>
      But this is the only case where we would use the return value and
      not use cursor->pfn as criteria to abort.<br>
      <br>
      So to be consistent I rather don't want to do this,<br>
      Christian.<br>
      <br>
      Am 25.10.18 um 17:43 schrieb Zhu, Rex:<br>
    </div>
    <blockquote type="cite"
cite="mid:BYAPR12MB2775D822132203F5E206128EFBF70@BYAPR12MB2775.namprd12.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Word 15 (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:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* 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.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;}
.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;}
--></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]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:black">How about add a
            return value for the function amdgpu_vm_pt_next?<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:black">And change the
            code as:<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:black">    <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:black">     ret =
            amdgpu_vm_pt_next(adev, cursor);<br>
            -       while (amdgpu_vm_pt_descendant(adev, cursor));<br>
            +       if (!ret)<br>
            +               while (amdgpu_vm_pt_descendant(adev,
            cursor));</span><o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Best Regards<o:p></o:p></p>
        <p class="MsoNormal">Rex<o:p></o:p></p>
        <div style="border:none;border-left:solid blue 1.5pt;padding:0in
          0in 0in 4.0pt">
          <div>
            <div style="border:none;border-top:solid #E1E1E1
              1.0pt;padding:3.0pt 0in 0in 0in">
              <p class="MsoNormal"><b>From:</b> amd-gfx
                <a class="moz-txt-link-rfc2396E" href="mailto:amd-gfx-bounces@lists.freedesktop.org"><amd-gfx-bounces@lists.freedesktop.org></a>
                <b>On Behalf Of </b>Zhu, Rex<br>
                <b>Sent:</b> Thursday, October 25, 2018 11:34 PM<br>
                <b>To:</b> Deucher, Alexander
                <a class="moz-txt-link-rfc2396E" href="mailto:Alexander.Deucher@amd.com"><Alexander.Deucher@amd.com></a>; Christian König
                <a class="moz-txt-link-rfc2396E" href="mailto:ckoenig.leichtzumerken@gmail.com"><ckoenig.leichtzumerken@gmail.com></a>;
                <a class="moz-txt-link-abbreviated" href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
                <b>Subject:</b> RE: [PATCH] drm/amdgpu: fix VM leaf
                walking<o:p></o:p></p>
            </div>
          </div>
          <p class="MsoNormal"><o:p> </o:p></p>
          <p class="MsoNormal">Patch is Tested-by:  Rex Zhu <a
              href="mailto:Rex.Zhu@amd.com" moz-do-not-send="true">
              Rex.Zhu@amd.com</a><o:p></o:p></p>
          <p class="MsoNormal"><o:p> </o:p></p>
          <p class="MsoNormal">Regards<o:p></o:p></p>
          <p class="MsoNormal">Rex<o:p></o:p></p>
          <p class="MsoNormal"><o:p> </o:p></p>
          <div style="border:none;border-left:solid blue
            1.5pt;padding:0in 0in 0in 4.0pt">
            <div>
              <div style="border:none;border-top:solid #E1E1E1
                1.0pt;padding:3.0pt 0in 0in 0in">
                <p class="MsoNormal"><b>From:</b> amd-gfx <<a
                    href="mailto:amd-gfx-bounces@lists.freedesktop.org"
                    moz-do-not-send="true">amd-gfx-bounces@lists.freedesktop.org</a>>
                  <b>On Behalf Of </b>Deucher, Alexander<br>
                  <b>Sent:</b> Thursday, October 25, 2018 11:08 PM<br>
                  <b>To:</b> Christian König <<a
                    href="mailto:ckoenig.leichtzumerken@gmail.com"
                    moz-do-not-send="true">ckoenig.leichtzumerken@gmail.com</a>>;
                  <a href="mailto:amd-gfx@lists.freedesktop.org"
                    moz-do-not-send="true">amd-gfx@lists.freedesktop.org</a><br>
                  <b>Subject:</b> Re: [PATCH] drm/amdgpu: fix VM leaf
                  walking<o:p></o:p></p>
              </div>
            </div>
            <p class="MsoNormal"><o:p> </o:p></p>
            <div id="divtagdefaultwrapper">
              <p><span style="font-size:12.0pt;color:black">Acked-by:
                  Alex Deucher <<a
                    href="mailto:alexander.deucher@amd.com"
                    moz-do-not-send="true">alexander.deucher@amd.com</a>><o:p></o:p></span></p>
              <p class="MsoNormal"><span
                  style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
              <div>
                <div class="MsoNormal" style="text-align:center"
                  align="center"><span
                    style="font-size:12.0pt;color:black">
                    <hr width="98%" size="3" align="center">
                  </span></div>
                <div id="divRplyFwdMsg">
                  <p class="MsoNormal"><b><span style="color:black">From:</span></b><span
                      style="color:black"> amd-gfx <<a
                        href="mailto:amd-gfx-bounces@lists.freedesktop.org"
                        moz-do-not-send="true">amd-gfx-bounces@lists.freedesktop.org</a>>
                      on behalf of Christian König <<a
                        href="mailto:ckoenig.leichtzumerken@gmail.com"
                        moz-do-not-send="true">ckoenig.leichtzumerken@gmail.com</a>><br>
                      <b>Sent:</b> Thursday, October 25, 2018 10:38 AM<br>
                      <b>To:</b> <a
                        href="mailto:amd-gfx@lists.freedesktop.org"
                        moz-do-not-send="true">amd-gfx@lists.freedesktop.org</a><br>
                      <b>Subject:</b> [PATCH] drm/amdgpu: fix VM leaf
                      walking</span><span
                      style="font-size:12.0pt;color:black">
                      <o:p></o:p></span></p>
                  <div>
                    <p class="MsoNormal"><span
                        style="font-size:12.0pt;color:black"> <o:p></o:p></span></p>
                  </div>
                </div>
                <div>
                  <div>
                    <p class="MsoNormal"><span style="color:black">Make
                        sure we don't try to go down further after the
                        leave walk already<br>
                        ended. This fixes a crash with a new VM test.<br>
                        <br>
                        Signed-off-by: Christian König <<a
                          href="mailto:christian.koenig@amd.com"
                          moz-do-not-send="true">christian.koenig@amd.com</a>><br>
                        ---<br>
                         drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 3 ++-<br>
                         1 file changed, 2 insertions(+), 1 deletion(-)<br>
                        <br>
                        diff --git
                        a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
                        b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c<br>
                        index db0cbf8d219d..352b30409060 100644<br>
                        --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c<br>
                        +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c<br>
                        @@ -542,7 +542,8 @@ static void
                        amdgpu_vm_pt_next_leaf(struct amdgpu_device
                        *adev,<br>
                                                            struct
                        amdgpu_vm_pt_cursor *cursor)<br>
                         {<br>
                                 amdgpu_vm_pt_next(adev, cursor);<br>
                        -       while (amdgpu_vm_pt_descendant(adev,
                        cursor));<br>
                        +       if (cursor->pfn != ~0ll)<br>
                        +               while
                        (amdgpu_vm_pt_descendant(adev, cursor));<br>
                         }<br>
                         <br>
                         /**<br>
                        -- <br>
                        2.17.1<br>
                        <br>
                        _______________________________________________<br>
                        amd-gfx mailing list<br>
                        <a href="mailto:amd-gfx@lists.freedesktop.org"
                          moz-do-not-send="true">amd-gfx@lists.freedesktop.org</a><br>
                        <a
                          href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx"
                          moz-do-not-send="true">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><o:p></o:p></span></p>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>