Skip to content

Commit 00907da

Browse files
nvishwa1rodrigovivi
authored andcommitted
drm/xe/multi_queue: Fix secondary queue error case
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: d716a50 ("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 d2d23c1) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
1 parent 6df5678 commit 00907da

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

drivers/gpu/drm/xe/xe_guc_submit.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,6 +1673,14 @@ static void guc_exec_queue_fini(struct xe_exec_queue *q)
16731673
struct xe_guc_exec_queue *ge = q->guc;
16741674
struct xe_guc *guc = exec_queue_to_guc(q);
16751675

1676+
if (xe_exec_queue_is_multi_queue_secondary(q)) {
1677+
struct xe_exec_queue_group *group = q->multi_queue.group;
1678+
1679+
mutex_lock(&group->list_lock);
1680+
list_del(&q->multi_queue.link);
1681+
mutex_unlock(&group->list_lock);
1682+
}
1683+
16761684
release_guc_id(guc, q);
16771685
xe_sched_entity_fini(&ge->entity);
16781686
xe_sched_fini(&ge->sched);
@@ -1694,14 +1702,6 @@ static void __guc_exec_queue_destroy_async(struct work_struct *w)
16941702
guard(xe_pm_runtime)(guc_to_xe(guc));
16951703
trace_xe_exec_queue_destroy(q);
16961704

1697-
if (xe_exec_queue_is_multi_queue_secondary(q)) {
1698-
struct xe_exec_queue_group *group = q->multi_queue.group;
1699-
1700-
mutex_lock(&group->list_lock);
1701-
list_del(&q->multi_queue.link);
1702-
mutex_unlock(&group->list_lock);
1703-
}
1704-
17051705
/* Confirm no work left behind accessing device structures */
17061706
cancel_delayed_work_sync(&ge->sched.base.work_tdr);
17071707

0 commit comments

Comments
 (0)