]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdkfd: Don't clear PT after process killed
authorPhilip Yang <Philip.Yang@amd.com>
Fri, 31 Oct 2025 14:50:02 +0000 (10:50 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:37:47 +0000 (15:37 -0500)
commit 597eb70f7ff7551ff795cd51754b81aabedab67b upstream.

If process is killed. the vm entity is stopped, submit pt update job
will trigger the error message "*ERROR* Trying to push to a killed
entity", job will not execute.

Suggested-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 10c382ec6c6d1e11975a11962bec21cba6360391)
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c

index 30d4a47535882af70d2a73043d73cfd36dd1c434..8994ed564f35d73e7ef4c30fd8a1aae5c63c4703 100644 (file)
@@ -1263,6 +1263,10 @@ static int unmap_bo_from_gpuvm(struct kgd_mem *mem,
 
        (void)amdgpu_vm_bo_unmap(adev, bo_va, entry->va);
 
+       /* VM entity stopped if process killed, don't clear freed pt bo */
+       if (!amdgpu_vm_ready(vm))
+               return 0;
+
        (void)amdgpu_vm_clear_freed(adev, vm, &bo_va->last_pt_update);
 
        (void)amdgpu_sync_fence(sync, bo_va->last_pt_update, GFP_KERNEL);