From: "Summers, Stuart" <stuart.summers@intel.com>
To: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"Yadav, Arvind" <arvind.yadav@intel.com>
Cc: "Vivi, Rodrigo" <rodrigo.vivi@intel.com>,
"Brost, Matthew" <matthew.brost@intel.com>,
"Ghimiray, Himal Prasad" <himal.prasad.ghimiray@intel.com>,
"Upadhyay, Tejas" <tejas.upadhyay@intel.com>,
"thomas.hellstrom@linux.intel.com"
<thomas.hellstrom@linux.intel.com>
Subject: Re: [PATCH] drm/xe/guc: Do not trigger TDR from the memory CAT error handler
Date: Wed, 18 Nov 2026 20:38:30 +0000 [thread overview]
Message-ID: <04c50600f64b0798c62f92995aa36bb0f56c434e.camel@intel.com> (raw)
In-Reply-To: <20261116102020.1567127-1-arvind.yadav@intel.com>
On Mon, 2026-11-16 at 15:50 +0530, Arvind Yadav wrote:
> The memory CAT error handler uses the same cleanup path as the
> context-reset handler. This immediately triggers the TDR, which can
> send a scheduling-disable request before the context-reset
> notification
> arrives.
>
> On a BMG dGPU, an early disable after a CCS memory CAT error is
> associated with subsequent contexts being enabled but never starting
> work. Recovery occurs later when a scheduling-disable timeout
> triggers
> a GT reset.
>
> Separate waking user-fence waiters from triggering the TDR. On a
> memory
> CAT notification, mark the queue reset and wake waiters without
> starting
> the TDR. Keep the existing cleanup triggered by the context-reset
> notification.
>
> Leave the uncorrectable-error and CGP context-error paths unchanged.
>
> Tested on a BMG dGPU using a standalone SYCL reproducer with two
> separate processes.
>
> The first process submits a kernel that reads an unmapped GPU
> address,
> causing a page fault followed by a memory CAT error. It then calls
> abort() without waiting for the kernel to finish.
>
> After that process exits, a second process, called "victim", starts.
> It submits a simple kernel that writes 7 to a device allocation,
> copies the value back to the CPU and checks the result.
>
> Without the patch, the victim can hang and reach its 60-second
> userspace timeout. With the patch, the victim completed and returned
> the expected value in all tested rounds where the first process
> triggered
> the fault.
>
> Recovery without a context-reset notification still needs
> confirmation,
> particularly for LR queues, which have no normal finite job timeout.
> Independent queue-kill and cleanup paths are unchanged.
>
> Cc: Matthew Brost <matthew.brost@intel.com>
> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Tejas Upadhyay <tejas.upadhyay@intel.com>
> Assisted-by: LLM
> Signed-off-by: Arvind Yadav <arvind.yadav@intel.com>
This isn't right... I'm not clear on what problem we're trying to solve
here. Is it that the engine reset happening after CAT error is taking
too long? And where is the schedule disable originating? If it's part
of the TDR that means we likely want to re-arrange the TDR sequence
rather than just skip it.
Engine reset is required after a CAT error to recover and the driver is
doing that as part of this flow (vs an engine reset due to a preemption
failure which originates from GuC and the driver just reacts to that).
Thanks,
Stuart
> ---
> drivers/gpu/drm/xe/xe_guc_submit.c | 50 ++++++++++++++++++++++------
> --
> 1 file changed, 37 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c
> b/drivers/gpu/drm/xe/xe_guc_submit.c
> index d76f125f9c3a..aa382634a235 100644
> --- a/drivers/gpu/drm/xe/xe_guc_submit.c
> +++ b/drivers/gpu/drm/xe/xe_guc_submit.c
> @@ -557,17 +557,39 @@ static bool vf_recovery(struct xe_guc *guc)
> return xe_gt_recovery_pending(guc_to_gt(guc));
> }
>
> -static void xe_guc_exec_queue_trigger_cleanup(struct xe_exec_queue
> *q)
> +static void xe_guc_exec_queue_wake_ufence(struct xe_exec_queue *q)
> {
> struct xe_guc *guc = exec_queue_to_guc(q);
> struct xe_device *xe = guc_to_xe(guc);
>
> /** to wakeup xe_wait_user_fence ioctl if exec queue is reset
> */
> wake_up_all(&xe->ufence_wq);
> +}
> +
> +static void xe_guc_exec_queue_trigger_cleanup(struct xe_exec_queue
> *q)
> +{
> + xe_guc_exec_queue_wake_ufence(q);
>
> xe_sched_tdr_queue_imm(&q->guc->sched);
> }
>
> +/*
> + * Allow callers to wake user-fence waiters without triggering the
> TDR.
> + * The memory CAT handler uses this to avoid starting cleanup before
> + * the context-reset notification arrives.
> + */
> +static void xe_queue_trigger_cleanup_for_reset(struct xe_exec_queue
> *q,
> + bool trigger_tdr)
> +{
> + if (exec_queue_banned(q))
> + return;
> +
> + if (trigger_tdr)
> + xe_guc_exec_queue_trigger_cleanup(q);
> + else
> + xe_guc_exec_queue_wake_ufence(q);
> +}
> +
> static void xe_guc_exec_queue_group_stop(struct xe_exec_queue *q)
> {
> struct xe_exec_queue *primary =
> xe_exec_queue_multi_queue_primary(q);
> @@ -653,7 +675,8 @@ static void
> xe_guc_exec_queue_group_trigger_cleanup(struct xe_exec_queue *q)
> mutex_unlock(&group->list_lock);
> }
>
> -static void xe_guc_exec_queue_reset_trigger_cleanup(struct
> xe_exec_queue *q)
> +static void xe_guc_exec_queue_reset_trigger_cleanup(struct
> xe_exec_queue *q,
> + bool trigger_tdr)
> {
> if (xe_exec_queue_is_multi_queue(q)) {
> struct xe_exec_queue *primary =
> xe_exec_queue_multi_queue_primary(q);
> @@ -664,20 +687,17 @@ static void
> xe_guc_exec_queue_reset_trigger_cleanup(struct xe_exec_queue *q)
> WRITE_ONCE(group->banned, true);
>
> set_exec_queue_reset(primary);
> - if (!exec_queue_banned(primary))
> - xe_guc_exec_queue_trigger_cleanup(primary);
> + xe_queue_trigger_cleanup_for_reset(primary,
> trigger_tdr);
>
> mutex_lock(&group->list_lock);
> list_for_each_entry(eq, &group->list,
> multi_queue.link) {
> set_exec_queue_reset(eq);
> - if (!exec_queue_banned(eq))
> -
> xe_guc_exec_queue_trigger_cleanup(eq);
> + xe_queue_trigger_cleanup_for_reset(eq,
> trigger_tdr);
> }
> mutex_unlock(&group->list_lock);
> } else {
> set_exec_queue_reset(q);
> - if (!exec_queue_banned(q))
> - xe_guc_exec_queue_trigger_cleanup(q);
> + xe_queue_trigger_cleanup_for_reset(q, trigger_tdr);
> }
> }
>
> @@ -3523,7 +3543,7 @@ int xe_guc_exec_queue_reset_handler(struct
> xe_guc *guc, u32 *msg, u32 len)
> * jobs by setting timeout of the job to the minimum value
> kicking
> * guc_exec_queue_timedout_job.
> */
> - xe_guc_exec_queue_reset_trigger_cleanup(q);
> + xe_guc_exec_queue_reset_trigger_cleanup(q, true);
>
> return 0;
> }
> @@ -3601,8 +3621,12 @@ int
> xe_guc_exec_queue_memory_cat_error_handler(struct xe_guc *guc, u32
> *msg,
>
> trace_xe_exec_queue_memory_cat_error(q);
>
> - /* Treat the same as engine reset */
> - xe_guc_exec_queue_reset_trigger_cleanup(q);
> + /*
> + * Starting the TDR here can send a scheduling-disable
> request before
> + * the context-reset notification arrives. Mark the queue
> reset and
> + * wake user-fence waiters, leaving that notification to
> trigger cleanup.
> + */
> + xe_guc_exec_queue_reset_trigger_cleanup(q, false);
>
> return 0;
> }
> @@ -3644,7 +3668,7 @@ int xe_guc_uncorrectable_error_handler(struct
> xe_guc *guc, u32 *msg, u32 len)
> trace_xe_guc_uncorrectable_error(q);
>
> /* Treat the same as engine reset */
> - xe_guc_exec_queue_reset_trigger_cleanup(q);
> + xe_guc_exec_queue_reset_trigger_cleanup(q, true);
>
> return 0;
> }
> @@ -3696,7 +3720,7 @@ int
> xe_guc_exec_queue_cgp_context_error_handler(struct xe_guc *guc, u32
> *msg,
> trace_xe_exec_queue_cgp_context_error(q);
>
> /* Treat the same as engine reset */
> - xe_guc_exec_queue_reset_trigger_cleanup(q);
> + xe_guc_exec_queue_reset_trigger_cleanup(q, true);
>
> return 0;
> }
next prev parent reply other threads:[~2026-11-18 20:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 10:20 [PATCH] drm/xe/guc: Do not trigger TDR from the memory CAT error handler Arvind Yadav
2026-11-16 10:49 ` sashiko-bot
2026-11-16 12:49 ` ✗ CI.checkpatch: warning for " Patchwork
2026-11-16 12:52 ` ✓ CI.KUnit: success " Patchwork
2026-11-16 13:25 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-16 19:31 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-11-18 20:38 ` Summers, Stuart [this message]
2026-11-19 3:47 ` [PATCH] " Matthew Brost
2026-11-19 10:53 ` Yadav, Arvind
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=04c50600f64b0798c62f92995aa36bb0f56c434e.camel@intel.com \
--to=stuart.summers@intel.com \
--cc=arvind.yadav@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=himal.prasad.ghimiray@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.brost@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=tejas.upadhyay@intel.com \
--cc=thomas.hellstrom@linux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.