]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/multi_queue: Fix secondary queue error case
authorNiranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Mon, 18 May 2026 19:16:40 +0000 (12:16 -0700)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 19 May 2026 15:29:50 +0000 (11:29 -0400)
If xe_lrc_create() fails, the secondary queue added to the
multi-queue group list is not removed before freeing the
queue. Fix error path handling for secondary queues by
removing it from the multi-queue group list at the right
place.

Reported-by: Sebastian Ă–sterlund <sebastian.osterlund@intel.com>
Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/work_items/7979
Fixes: d716a5088c88 ("drm/xe/multi_queue: Handle tearing down of a multi queue")
Cc: stable@vger.kernel.org # v7.0+
Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patch.msgid.link/20260518191639.320890-2-niranjana.vishwanathapura@intel.com
(cherry picked from commit d2d23c12789cf69eddc35b8d38cd8eaabd0168f1)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_guc_submit.c

index 10556156eaadb3d204668730c9790c3fdf884d25..912182dc77043a39aeedd02c83f4d3b49164abe3 100644 (file)
@@ -1673,6 +1673,14 @@ static void guc_exec_queue_fini(struct xe_exec_queue *q)
        struct xe_guc_exec_queue *ge = q->guc;
        struct xe_guc *guc = exec_queue_to_guc(q);
 
+       if (xe_exec_queue_is_multi_queue_secondary(q)) {
+               struct xe_exec_queue_group *group = q->multi_queue.group;
+
+               mutex_lock(&group->list_lock);
+               list_del(&q->multi_queue.link);
+               mutex_unlock(&group->list_lock);
+       }
+
        release_guc_id(guc, q);
        xe_sched_entity_fini(&ge->entity);
        xe_sched_fini(&ge->sched);
@@ -1694,14 +1702,6 @@ static void __guc_exec_queue_destroy_async(struct work_struct *w)
        guard(xe_pm_runtime)(guc_to_xe(guc));
        trace_xe_exec_queue_destroy(q);
 
-       if (xe_exec_queue_is_multi_queue_secondary(q)) {
-               struct xe_exec_queue_group *group = q->multi_queue.group;
-
-               mutex_lock(&group->list_lock);
-               list_del(&q->multi_queue.link);
-               mutex_unlock(&group->list_lock);
-       }
-
        /* Confirm no work left behind accessing device structures */
        cancel_delayed_work_sync(&ge->sched.base.work_tdr);