diff options
author | Christian König <christian.koenig@amd.com> | 2019-01-30 16:12:51 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-02-06 05:16:22 +0300 |
commit | 90d647222a8f004bf1430ecea3099ebcc54bfc21 (patch) | |
tree | f101210c63306297abff087ff1b563ebe8548f14 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |
parent | 12a8bd8862ebd7d6e0f764120e2f322ddc077a11 (diff) | |
download | linux-90d647222a8f004bf1430ecea3099ebcc54bfc21.tar.xz |
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>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index a404ac17e5ae..93b936f7de4b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -1781,13 +1781,18 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, if (pages_addr) 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 */ r = amdgpu_vm_wait_pd(adev, vm, owner); if (unlikely(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.pages_addr = pages_addr; return amdgpu_vm_update_ptes(¶ms, start, last + 1, |