Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe/guc: skip TDR timeout check when ctx_timestamp is 0 or 1
@ 2026-09-04 18:09 Jia Yao
  2026-09-04 18:17 ` ✓ CI.KUnit: success for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Jia Yao @ 2026-09-04 18:09 UTC (permalink / raw)
  To: intel-xe; +Cc: Shuicheng Lin, Matthew Brost, Jia Yao

A ctx_timestamp of 0 or 1 indicates an invalid timestamp:
- 1 (CONTEXT_ACTIVE) is the cookie written by the WA BB immediately
  after a full context restore, before the spinner has run.
- 0 can occur when lrc->ctx_timestamp shadow is uninitialized or was
  last updated while the context was being restored.

In both cases the timestamp is not yet valid, so reset the sampling
baseline and wait for the next check_timeout() call.

Signed-off-by: Jia Yao <jia.yao@intel.com>
---
 drivers/gpu/drm/xe/xe_guc_submit.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
index 0a6e2b81b5a5..caf02d265533 100644
--- a/drivers/gpu/drm/xe/xe_guc_submit.c
+++ b/drivers/gpu/drm/xe/xe_guc_submit.c
@@ -1429,6 +1429,20 @@ static bool check_timeout(struct xe_exec_queue *q, struct xe_sched_job *job)
 		return xe_sched_invalidate_job(job, 0);
 	}
 
+	/*
+	 * A ctx_timestamp of 0 or 1 indicates an invalid timestamp:
+	 * - 1 (CONTEXT_ACTIVE) is the cookie written by the WA BB immediately
+	 *   after a full context restore, before the spinner has run.
+	 * - 0 can occur when lrc->ctx_timestamp shadow is uninitialized or was
+	 *   last updated while the context was being restored.
+	 * In both cases the timestamp is not yet valid, so reset the sampling
+	 * baseline and wait for the next check_timeout() call.
+	 */
+	if (ctx_timestamp <= 1) {
+		job->sample_timestamp = U64_MAX;
+		return false;
+	}
+
 	job->sample_timestamp = ctx_timestamp;
 	ctx_job_timestamp = xe_lrc_ctx_job_timestamp(q->lrc[0]);
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-09-07 19:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-04 18:09 [PATCH] drm/xe/guc: skip TDR timeout check when ctx_timestamp is 0 or 1 Jia Yao
2026-09-04 18:17 ` ✓ CI.KUnit: success for " Patchwork
2026-09-04 18:18 ` [PATCH] " Matthew Brost
2026-09-04 22:35   ` Umesh Nerlige Ramappa
2026-09-05  3:40     ` Yao, Jia
2026-09-07 19:17       ` Yao, Jia
2026-09-04 18:20 ` sashiko-bot
2026-09-04 18:55 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-09-05  2:18 ` ✓ Xe.CI.FULL: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox