Skip to content

Commit 207430b

Browse files
fxkamdalexdeucher
authored andcommitted
drm/amdgpu: Reserve fences for VM update
In amdgpu_dma_buf_move_notify reserve fences for the page table updates in amdgpu_vm_clear_freed and amdgpu_vm_handle_moved. This fixes a BUG_ON in dma_resv_add_fence when using SDMA for page table updates. Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent e6f8588 commit 207430b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,10 @@ amdgpu_dma_buf_move_notify(struct dma_buf_attachment *attach)
404404
continue;
405405
}
406406

407-
r = amdgpu_vm_clear_freed(adev, vm, NULL);
407+
/* Reserve fences for two SDMA page table updates */
408+
r = dma_resv_reserve_fences(resv, 2);
409+
if (!r)
410+
r = amdgpu_vm_clear_freed(adev, vm, NULL);
408411
if (!r)
409412
r = amdgpu_vm_handle_moved(adev, vm);
410413

0 commit comments

Comments
 (0)