]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdkfd: Fix pqm_destroy_queue race with GPU reset
authorPhilip Yang <Philip.Yang@amd.com>
Thu, 20 Feb 2025 21:02:13 +0000 (16:02 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 20 Apr 2025 08:17:50 +0000 (10:17 +0200)
[ Upstream commit 7919b4cad5545ed93778f11881ceee72e4dbed66 ]

If GPU in reset, destroy_queue return -EIO, pqm_destroy_queue should
delete the queue from process_queue_list and free the resource.

Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c

index 866b68146df6b61f2070c53010a045e73413faf3..e015296d8f0d2b86c2bd671b9f0a060e26e05611 100644 (file)
@@ -545,7 +545,7 @@ int pqm_destroy_queue(struct process_queue_manager *pqm, unsigned int qid)
                        pr_err("Pasid 0x%x destroy queue %d failed, ret %d\n",
                                pqm->process->pasid,
                                pqn->q->properties.queue_id, retval);
-                       if (retval != -ETIME)
+                       if (retval != -ETIME && retval != -EIO)
                                goto err_destroy_queue;
                }
                kfd_procfs_del_queue(pqn->q);