From a4c32e1b060a9cfd73d016063b7712101578162d Mon Sep 17 00:00:00 2001 From: jsg Date: Thu, 9 Nov 2023 08:16:47 +0000 Subject: [PATCH] drm/amdgpu: Reserve fences for VM update From Felix Kuehling ff86d69b2e5004ec256a9301990acdaa282a777c in linux-6.1.y/6.1.62 316baf09d355aec1179981b6dfe28eba50c5ee5b in mainline linux --- sys/dev/pci/drm/amd/amdgpu/amdgpu_dma_buf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_dma_buf.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_dma_buf.c index 15e0a1a5e67..09389154fae 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_dma_buf.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_dma_buf.c @@ -410,7 +410,10 @@ amdgpu_dma_buf_move_notify(struct dma_buf_attachment *attach) continue; } - r = amdgpu_vm_clear_freed(adev, vm, NULL); + /* Reserve fences for two SDMA page table updates */ + r = dma_resv_reserve_fences(resv, 2); + if (!r) + r = amdgpu_vm_clear_freed(adev, vm, NULL); if (!r) r = amdgpu_vm_handle_moved(adev, vm); -- 2.20.1