<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">That sounds reasonable.</p>
<p style="margin-top:0;margin-bottom:0">Thanks.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Best Regards</p>
<p style="margin-top:0;margin-bottom:0">Rex<br>
</p>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><b>From:</b> Christian König <ckoenig.leichtzumerken@gmail.com><br>
<b>Sent:</b> Friday, October 26, 2018 3:34 PM<br>
<b>To:</b> Zhu, Rex; Deucher, Alexander; amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> Re: [PATCH] drm/amdgpu: fix VM leaf walking</font>
<div> </div>
</div>
<meta content="text/html; charset=Windows-1252">
<div style="background-color:#FFFFFF">
<div class="x_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">
<meta name="x_Generator" content="Microsoft Word 15 (filtered
        medium)">
<div class="x_WordSection1">
<p class="x_MsoNormal"><span style="color:black">How about add a return value for the function amdgpu_vm_pt_next?</span></p>
<p class="x_MsoNormal"><span style="color:black">And change the code as:</span></p>
<p class="x_MsoNormal"><span style="color:black">    </span></p>
<p class="x_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></p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">Best Regards</p>
<p class="x_MsoNormal">Rex</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="x_MsoNormal"><b>From:</b> amd-gfx <a class="x_moz-txt-link-rfc2396E OWAAutoLink" href="mailto:amd-gfx-bounces@lists.freedesktop.org" id="LPlnk888612" previewremoved="true">
<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="x_moz-txt-link-rfc2396E OWAAutoLink" href="mailto:Alexander.Deucher@amd.com" id="LPlnk565645" previewremoved="true">
<Alexander.Deucher@amd.com></a>; Christian König <a class="x_moz-txt-link-rfc2396E OWAAutoLink" href="mailto:ckoenig.leichtzumerken@gmail.com" id="LPlnk287786" previewremoved="true">
<ckoenig.leichtzumerken@gmail.com></a>; <a class="x_moz-txt-link-abbreviated OWAAutoLink" href="mailto:amd-gfx@lists.freedesktop.org" id="LPlnk79687" previewremoved="true">
amd-gfx@lists.freedesktop.org</a><br>
<b>Subject:</b> RE: [PATCH] drm/amdgpu: fix VM leaf walking</p>
</div>
</div>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">Patch is Tested-by:  Rex Zhu <a href="mailto:Rex.Zhu@amd.com" id="LPlnk704517" class="OWAAutoLink" previewremoved="true">
Rex.Zhu@amd.com</a></p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">Regards</p>
<p class="x_MsoNormal">Rex</p>
<p class="x_MsoNormal"> </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="x_MsoNormal"><b>From:</b> amd-gfx <<a href="mailto:amd-gfx-bounces@lists.freedesktop.org" id="LPlnk256358" class="OWAAutoLink" previewremoved="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" id="LPlnk748474" class="OWAAutoLink" previewremoved="true">ckoenig.leichtzumerken@gmail.com</a>>;
<a href="mailto:amd-gfx@lists.freedesktop.org" id="LPlnk324756" class="OWAAutoLink" previewremoved="true">
amd-gfx@lists.freedesktop.org</a><br>
<b>Subject:</b> Re: [PATCH] drm/amdgpu: fix VM leaf walking</p>
</div>
</div>
<p class="x_MsoNormal"> </p>
<div id="x_divtagdefaultwrapper">
<p><span style="font-size:12.0pt; color:black">Acked-by: Alex Deucher <<a href="mailto:alexander.deucher@amd.com" id="LPlnk291278" class="OWAAutoLink" previewremoved="true">alexander.deucher@amd.com</a>></span></p>
<p class="x_MsoNormal"><span style="font-size:12.0pt; color:black"> </span></p>
<div>
<div class="x_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="x_divRplyFwdMsg">
<p class="x_MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> amd-gfx <<a href="mailto:amd-gfx-bounces@lists.freedesktop.org" id="LPlnk120770" class="OWAAutoLink" previewremoved="true">amd-gfx-bounces@lists.freedesktop.org</a>>
 on behalf of Christian König <<a href="mailto:ckoenig.leichtzumerken@gmail.com" id="LPlnk612085" class="OWAAutoLink" previewremoved="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" id="LPlnk951954" class="OWAAutoLink" previewremoved="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">
</span></p>
<div>
<p class="x_MsoNormal"><span style="font-size:12.0pt; color:black"> </span></p>
</div>
</div>
<div>
<div>
<p class="x_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" id="LPlnk86451" class="OWAAutoLink" previewremoved="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" id="LPlnk546581" class="OWAAutoLink" previewremoved="true">amd-gfx@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" id="LPlnk692300" class="OWAAutoLink" previewremoved="true">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
</div>
</div>
</div>
</body>
</html>