Skip to content

Commit 316baf0

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 51b79f3 commit 316baf0

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
@@ -403,7 +403,10 @@ amdgpu_dma_buf_move_notify(struct dma_buf_attachment *attach)
403403
continue;
404404
}
405405

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

0 commit comments

Comments
 (0)