<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Please also include a patch description so we understand why this change is needed.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Alex<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Christian König <ckoenig.leichtzumerken@gmail.com><br>
<b>Sent:</b> Wednesday, August 14, 2019 11:06 AM<br>
<b>To:</b> Ba, Gang <Gang.Ba@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Ba, Gang <Gang.Ba@amd.com><br>
<b>Subject:</b> Re: [PATCH] Update VM function point when VM state changed.</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Am 14.08.19 um 17:01 schrieb Gang Ba:<br>
> Change-Id: Ibcfada560a00c9aeebfd922ae48de920e44a5866<br>
> Signed-off-by: Gang Ba <gaba@amd.com><br>
<br>
Good catch, but there is a problem below.<br>
<br>
> ---<br>
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 6 ++++++<br>
>   1 file changed, 6 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 c1baf3d..72dd434 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c<br>
> @@ -2862,6 +2862,12 @@ int amdgpu_vm_make_compute(struct amdgpu_device *adev, struct amdgpu_vm *vm, uns<br>
>        WARN_ONCE((vm->use_cpu_for_update && !amdgpu_gmc_vram_full_visible(&adev->gmc)),<br>
>                  "CPU update of VM recommended only for large BAR system\n");<br>
>   <br>
> +     if (vm->use_cpu_for_update)<br>
> +             vm->update_funcs = &amdgpu_vm_cpu_funcs;<br>
> +     else<br>
> +             vm->update_funcs = &amdgpu_vm_sdma_funcs;<br>
> +     vm->last_update = NULL;<br>
<br>
You can't just set last_update to NULL or your would leak the memory the <br>
fence occupies. So this needs to be:<br>
<br>
dma_fence_put(vm->last_update);<br>
vm->last_update = NULL;<br>
<br>
Regards,<br>
Christian.<br>
<br>
> +<br>
>        if (vm->pasid) {<br>
>                unsigned long flags;<br>
>   <br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a></div>
</span></font></div>
</body>
</html>