From: Jia Yao <jia.yao@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Shuicheng Lin <shuicheng.lin@intel.com>,
Matthew Brost <matthew.brost@intel.com>,
Jia Yao <jia.yao@intel.com>
Subject: [PATCH] drm/xe/guc: skip TDR timeout check when ctx_timestamp is 0 or 1
Date: Fri, 4 Sep 2026 18:09:43 +0000 [thread overview]
Message-ID: <20260904180943.3455267-1-jia.yao@intel.com> (raw)
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
next reply other threads:[~2026-09-04 18:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 18:09 Jia Yao [this message]
2026-09-04 18:17 ` ✓ CI.KUnit: success for drm/xe/guc: skip TDR timeout check when ctx_timestamp is 0 or 1 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260904180943.3455267-1-jia.yao@intel.com \
--to=jia.yao@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.brost@intel.com \
--cc=shuicheng.lin@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox