<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<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:"Segoe UI";
panose-1:2 11 5 2 4 2 4 2 2 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";
color:black;}
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;
margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";
color:black;}
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";
color:black;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";
color:black;}
span.EmailStyle20
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle21
{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;}
--></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 bgcolor="white" 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">Wait, nevermind. It would be good to add a comment that addr needs to be reset to 0 in this case since it's used below in the amdgpu_vm_frag_ptes().<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">The patch is:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Reviewed-by: Alex Deucher <alexander.deucher@amd.com><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>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<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:windowtext">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext"> amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org]
<b>On Behalf Of </b>Deucher, Alexander<br>
<b>Sent:</b> Monday, September 26, 2016 11:17 AM<br>
<b>To:</b> 'Christian König'; StDenis, Tom; Cui, Flora<br>
<b>Cc:</b> Huang, Ray; amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> RE: [PATCH] drm/amdgpu: fix addr handling in amdgpu_vm_bo_update_mapping<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Maybe it would be cleaner to just pass 0 to amdgpu_vm_frag_ptes() or remove the parameter altogether.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Alex</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><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 #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:windowtext">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext"> amd-gfx [<a href="mailto:amd-gfx-bounces@lists.freedesktop.org">mailto:amd-gfx-bounces@lists.freedesktop.org</a>]
<b>On Behalf Of </b>Christian König<br>
<b>Sent:</b> Monday, September 26, 2016 11:12 AM<br>
<b>To:</b> StDenis, Tom; Cui, Flora<br>
<b>Cc:</b> Huang, Ray; <a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
<b>Subject:</b> Re: [PATCH] drm/amdgpu: fix addr handling in amdgpu_vm_bo_update_mapping</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<p class="MsoNormal">The function called is either amdgpu_vm_do_set_ptes() or amdgpu_vm_do_copy_ptes().<br>
<br>
But that is actually rather unrelated to the local handling of addr in the function changed.<br>
<br>
The point here is we have handled the address offset by giving it to amdgpu_vm_map_gart() and so we shouldn't add the address again.<br>
<br>
Regards,<br>
Christian.<br>
<br>
Am 26.09.2016 um 15:46 schrieb StDenis, Tom:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div id="divtagdefaultwrapper">
<p style="background:white"><span style="font-family:"Calibri","sans-serif"">I'm reading through the amdgpu_vm.c to try and see if the patch is correct but I'm not that familiar with the VM side of things. It seems to boil down to calling params->func() with
a new dst value of NULL but that's where I'm stopped at the moment since I don't know what func() is. Nothing up to that point looks overtly wrong (like trying to use that address as a source for a read/write).</span><o:p></o:p></p>
<p style="background:white"><span style="font-family:"Calibri","sans-serif""> </span><o:p></o:p></p>
<p style="background:white"><span style="font-family:"Calibri","sans-serif"">Tom</span><o:p></o:p></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif""> </span><o:p></o:p></p>
<div>
<div>
<div class="MsoNormal" align="center" style="text-align:center;background:white">
<span style="font-family:"Calibri","sans-serif"">
<hr size="2" width="98%" align="center">
</span></div>
<div id="x_divRplyFwdMsg">
<p class="MsoNormal" style="background:white"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> amd-gfx
<a href="mailto:amd-gfx-bounces@lists.freedesktop.org"><amd-gfx-bounces@lists.freedesktop.org></a> on behalf of Christian König
<a href="mailto:deathsimple@vodafone.de"><deathsimple@vodafone.de></a><br>
<b>Sent:</b> Monday, September 26, 2016 09:29<br>
<b>To:</b> Cui, Flora<br>
<b>Cc:</b> Huang, Ray; <a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
<b>Subject:</b> Re: [PATCH] drm/amdgpu: fix addr handling in amdgpu_vm_bo_update_mapping</span><span style="font-family:"Calibri","sans-serif"">
</span><o:p></o:p></p>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif""> </span><o:p></o:p></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Calibri","sans-serif"">Yeah, that wouldn't really help but just make the problem more unlikely
<br>
to happen once more.<br>
<br>
Anyway Tom St confirmed that the patch seems to work for the open stack.<br>
<br>
Anybody brave enough to throw an rb on this so that I can commit it?<br>
<br>
Thanks,<br>
Christian.<br>
<br>
Am 26.09.2016 um 11:16 schrieb Flora Cui:<br>
> please ignore this patch. it actually revert the gtt mgr changes.<br>
><br>
> On Mon, Sep 26, 2016 at 03:19:01PM +0800, Flora Cui wrote:<br>
>> On Sun, Sep 25, 2016 at 11:55:13AM +0200, Christian König wrote:<br>
>>> From: Christian König <a href="mailto:christian.koenig@amd.com"><christian.koenig@amd.com></a><br>
>>><br>
>>> Otherwise we will look at the wrong place in the IB when GART<br>
>>> mappings are split into smaller updates.<br>
>>><br>
>>> Signed-off-by: Christian König <a href="mailto:christian.koenig@amd.com"><christian.koenig@amd.com></a><br>
>>> ---<br>
>>> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 1 +<br>
>>> 1 file changed, 1 insertion(+)<br>
>>><br>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c<br>
>>> index 2bb78dc..da31189 100644<br>
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c<br>
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c<br>
>>> @@ -1017,6 +1017,7 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,<br>
>>> AMDGPU_GPU_PAGE_SIZE);<br>
>>> pte[i] |= flags;<br>
>>> }<br>
>>> + addr = 0;<br>
>>> }<br>
>>> <br>
>>> r = amdgpu_sync_fence(adev, &job->sync, exclusive);<br>
>>> -- <br>
>>> 2.5.0<br>
>>><br>
>>><br>
>> IMHO this could fix the vmfault issue.<br>
>><br>
>> 8<---<br>
>> From cc7b5618665defd88e2adcd6f735562ecd784298 Mon Sep 17 00:00:00 2001<br>
>> From: Flora Cui <a href="mailto:Flora.Cui@amd.com"><Flora.Cui@amd.com></a><br>
>> Date: Mon, 26 Sep 2016 15:14:02 +0800<br>
>> Subject: [PATCH] drm/amdgpu: add ttm_bind in amdgpu_vm_bo_update()<br>
>><br>
>> Change-Id: If73d5b06e9188e40250ccdfd1a2a659ed1ef52a6<br>
>> Signed-off-by: Flora Cui <a href="mailto:Flora.Cui@amd.com"><Flora.Cui@amd.com></a><br>
>> ---<br>
>> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 ++<br>
>> 1 file changed, 2 insertions(+)<br>
>><br>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c<br>
>> index 2bb78dc..7f17127 100644<br>
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c<br>
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c<br>
>> @@ -1166,6 +1166,8 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,<br>
>> ttm = container_of(bo_va->bo->tbo.ttm, struct<br>
>> ttm_dma_tt, ttm);<br>
>> pages_addr = ttm->dma_address;<br>
>> + amdgpu_ttm_bind(&bo_va->bo->tbo, mem);<br>
>> + addr = (u64)mem->start << PAGE_SHIFT;<br>
>> break;<br>
>> <br>
>> case TTM_PL_VRAM:<br>
>> -- <br>
>> 2.7.4<br>
>><br>
>><br>
>> _______________________________________________<br>
>> amd-gfx mailing list<br>
>> <a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
>> <a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" id="LPlnk752113">
https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a> </span><o:p></o:p></p>
<div style="margin-bottom:15.0pt;overflow:auto" id="LPBorder_GT_14748974921180.061148974248180776">
<table class="MsoNormalTable" border="1" cellspacing="0" cellpadding="0" width="90%" style="width:90.0%;border-top:dotted #C8C8C8 1.0pt;border-left:none;border-bottom:dotted #C8C8C8 1.0pt;border-right:none">
<tbody>
<tr>
<td valign="top" style="border:none;padding:0in 0in 0in 0in">
<div id="LPTitle_14748974921170.667584414663523">
<p class="MsoNormal" style="margin-top:15.0pt;mso-line-height-alt:15.75pt"><span style="font-size:16.0pt;font-family:"Tahoma","sans-serif";color:#3B5777"><a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" target="_blank"><span style="text-decoration:none">amd-gfx
Info Page - lists.freedesktop.org</span></a></span><o:p></o:p></p>
</div>
<div style="margin-top:7.5pt;margin-bottom:12.0pt" id="LPMetadata_14748974921170.8198680036506909">
<p class="MsoNormal" style="margin-top:15.0pt;line-height:10.5pt"><span style="font-size:10.5pt;font-family:"Arial","sans-serif";color:#666666">lists.freedesktop.org</span><o:p></o:p></p>
</div>
<div id="LPDescription_14748974921180.08916125964466382">
<p class="MsoNormal" style="margin-top:15.0pt;line-height:15.0pt"><span style="font-size:10.5pt;font-family:"Segoe UI","sans-serif"">To see the collection of prior postings to the list, visit the amd-gfx Archives. Using amd-gfx: To post a message to all the
list members, send email ...</span><o:p></o:p></p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Calibri","sans-serif""><br>
<br>
> _______________________________________________<br>
> amd-gfx mailing list<br>
> <a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a></span><o:p></o:p></p>
</div>
</div>
</div>
</blockquote>
<p> <o:p></o:p></p>
</div>
</div>
</div>
</body>
</html>