Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jia Yao" <jia.yao@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH] drm/xe/guc: skip TDR timeout check when ctx_timestamp is 0 or 1
Date: Fri, 04 Sep 2026 18:20:04 +0000	[thread overview]
Message-ID: <20260904182005.4FBEB1F00A3F@smtp.kernel.org> (raw)
In-Reply-To: <20260904180943.3455267-1-jia.yao@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Resetting `job->sample_timestamp` to `U64_MAX` when `ctx_timestamp <= 1` unconditionally bypasses the TDR watchdog if the GPU hangs during context restore, causing an infinite loop that completely disables hang recovery.
--

commit e50d47eb7a620614e04b8e05f251f148a49a7005
Author: Jia Yao <jia.yao@intel.com>

drm/xe/guc: skip TDR timeout check when ctx_timestamp is 0 or 1

This commit updates the TDR timeout check to skip when ctx_timestamp
is 0 or 1. It resets the sampling baseline instead, under the assumption
that the timestamp is not yet valid.

> diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
> --- a/drivers/gpu/drm/xe/xe_guc_submit.c
> +++ b/drivers/gpu/drm/xe/xe_guc_submit.c
[ ... ]
> @@ -1428,6 +1428,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;
> +	}
> +

[Severity: High]
Does this unconditionally bypass the TDR watchdog if the GPU hangs during a
context restore?

If the hardware stalls while ctx_timestamp is 0 or 1 (e.g., during context
restore or while the WA BB is executing), check_timeout() will continuously
reset job->sample_timestamp to U64_MAX and return false.

On all subsequent TDR ticks, ctx_timestamp will still be 0 or 1, which does
not equal U64_MAX. Won't this repeat the reset and return false indefinitely,
preventing the DRM scheduler from ever invalidating the job and triggering a
GPU reset?

>  	job->sample_timestamp = ctx_timestamp;
>  	ctx_job_timestamp = xe_lrc_ctx_job_timestamp(q->lrc[0]);
>

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260904180943.3455267-1-jia.yao@intel.com?part=1

  parent reply	other threads:[~2026-09-04 18:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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=20260904182005.4FBEB1F00A3F@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jia.yao@intel.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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