drm/amdgpu: fix waiting for BO moves with CPU based PD/PT updates
Otherwise we open up the possibility to use uninitialized memory. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
12a8bd8862
commit
90d647222a
@@ -1781,13 +1781,18 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
|
|||||||
if (pages_addr)
|
if (pages_addr)
|
||||||
params.src = ~0;
|
params.src = ~0;
|
||||||
|
|
||||||
/* Wait for PT BOs to be free. PTs share the same resv. object
|
/* Wait for PT BOs to be idle. PTs share the same resv. object
|
||||||
* as the root PD BO
|
* as the root PD BO
|
||||||
*/
|
*/
|
||||||
r = amdgpu_vm_wait_pd(adev, vm, owner);
|
r = amdgpu_vm_wait_pd(adev, vm, owner);
|
||||||
if (unlikely(r))
|
if (unlikely(r))
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
/* Wait for any BO move to be completed */
|
||||||
|
r = dma_fence_wait(exclusive, true);
|
||||||
|
if (unlikely(r))
|
||||||
|
return r;
|
||||||
|
|
||||||
params.func = amdgpu_vm_cpu_set_ptes;
|
params.func = amdgpu_vm_cpu_set_ptes;
|
||||||
params.pages_addr = pages_addr;
|
params.pages_addr = pages_addr;
|
||||||
return amdgpu_vm_update_ptes(¶ms, start, last + 1,
|
return amdgpu_vm_update_ptes(¶ms, start, last + 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user