From 123c1f04303697ecf156642ee3376767c7a81930 Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Wed, 30 Sep 2026 15:10:35 +0530 Subject: [PATCH] drm/xe/guc: Rewind the LRC ring head when replaying a ULLS job On GT reset replay, guc_exec_queue_start() rewinds the software ring tail to the first unsignalled job's head and sets the LRC tail to the LRC head. This assumes the saved head has not passed an unstarted job, which holds for ordinary submission as the CS cannot run past a job it has not executed. A ULLS job's slot is covered by a tail its predecessor published from within the ring, so the CS can consume the slot and idle without the job having run, leaving the saved head past it. On replay the job is re-emitted behind the head, the context restarts with head == tail and the job never starts. Rewind the LRC head to the job's head as well when the first pending job is a ULLS job, so the re-emitted job is ahead of it. Non-ULLS replay is unchanged. Fixes: 40c756bdbbee ("drm/xe: Add ULLS migration job support to GuC submission") Cc: Matthew Brost Assisted-by: LLM Signed-off-by: Varun Gupta Reviewed-by: Matthew Brost Signed-off-by: Matthew Brost Link: https://patch.msgid.link/20260930094031.3365707-8-varun.gupta@intel.com Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/xe/xe_guc_submit.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c index 1d98ec67c5c6..0b231228bde8 100644 --- a/drivers/gpu/drm/xe/xe_guc_submit.c +++ b/drivers/gpu/drm/xe/xe_guc_submit.c @@ -3058,6 +3058,15 @@ static void guc_exec_queue_start(struct xe_exec_queue *q) * increasing as jobs are written out. */ q->lrc[i]->ring.tail = job->ptrs[i].head; + /* + * A ULLS job's slot can have been consumed by + * the CS without the job running, leaving the + * saved head past it. Rewind so the re-emitted + * job is ahead of the head, not behind it. + */ + if (xe_sched_job_is_ulls(job)) + xe_lrc_set_ring_head(q->lrc[i], + job->ptrs[i].head); xe_lrc_set_ring_tail(q->lrc[i], xe_lrc_ring_head(q->lrc[i])); }