drm/amdgpu: avoid restore process run into dead loop.
authorjsg <jsg@openbsd.org>
Wed, 26 Jul 2023 06:39:07 +0000 (06:39 +0000)
committerjsg <jsg@openbsd.org>
Wed, 26 Jul 2023 06:39:07 +0000 (06:39 +0000)
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

index 2d8e849..388b1e2 100644 (file)
@@ -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) {