From 08003bbdbebf0a2b44248bb2681c3e0548e7c7b3 Mon Sep 17 00:00:00 2001 From: jsg Date: Wed, 26 Jul 2023 06:39:07 +0000 Subject: [PATCH] drm/amdgpu: avoid restore process run into dead loop. From gaba fe26d0fa9408896e821d1c8dd2ab52171da03ed9 in linux-6.1.y/6.1.40 8a774fe912ff09e39c2d3a3589c729330113f388 in mainline linux --- sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c index 2d8e849e189..388b1e23be7 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c @@ -2737,6 +2737,9 @@ int amdgpu_amdkfd_gpuvm_restore_process_bos(void *info, struct dma_fence **ef) if (!attachment->is_mapped) continue; + if (attachment->bo_va->base.bo->tbo.pin_count) + continue; + kfd_mem_dmaunmap_attachment(mem, attachment); ret = update_gpuvm_pte(mem, attachment, &sync_obj); if (ret) { -- 2.20.1