From: Raag Jadav <raag.jadav@intel.com>
To: Matthew Brost <matthew.brost@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [RFC PATCH 3/3] drm/xe: Trigger queue cleanup if not in wedged mode 2
Date: Sat, 13 Dec 2025 08:58:14 +0100 [thread overview]
Message-ID: <aT0clhiMQQvMk02_@black.igk.intel.com> (raw)
In-Reply-To: <20251212233444.1717326-4-matthew.brost@intel.com>
On Fri, Dec 12, 2025 at 03:34:44PM -0800, Matthew Brost wrote:
> The intent of wedging a device is to allow queues to continue running
> only in wedged mode 2. In other modes, queues should initiate cleanup
> and signal all remaining fences. Fix xe_guc_submit_wedge to correctly
> clean up queues when wedge mode != 2.
>
> Fixes: 7dbe8af13c18 ("drm/xe: Wedge the entire device")
> Cc: stable@vger.kernel.org
> Signed-off-by: Matthew Brost <matthew.brost@intel.com>
> ---
> drivers/gpu/drm/xe/xe_guc_submit.c | 31 ++++++++++++++++++------------
> 1 file changed, 19 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
> index 857375be9a84..1eef93d474f0 100644
> --- a/drivers/gpu/drm/xe/xe_guc_submit.c
> +++ b/drivers/gpu/drm/xe/xe_guc_submit.c
> @@ -1277,6 +1277,7 @@ static void disable_scheduling_deregister(struct xe_guc *guc,
> */
> void xe_guc_submit_wedge(struct xe_guc *guc)
> {
> + struct xe_device *xe = guc_to_xe(guc);
> struct xe_gt *gt = guc_to_gt(guc);
> struct xe_exec_queue *q;
> unsigned long index;
> @@ -1291,19 +1292,25 @@ void xe_guc_submit_wedge(struct xe_guc *guc)
> if (!guc->submission_state.initialized)
> return;
>
> - err = devm_add_action_or_reset(guc_to_xe(guc)->drm.dev,
> - guc_submit_wedged_fini, guc);
> - if (err) {
> - xe_gt_err(gt, "Failed to register clean-up on wedged.mode=2; "
> - "Although device is wedged.\n");
> - return;
> - }
> + if (xe->wedged.mode == 2) {
> + err = devm_add_action_or_reset(guc_to_xe(guc)->drm.dev,
> + guc_submit_wedged_fini, guc);
> + if (err) {
> + xe_gt_err(gt, "Failed to register clean-up on wedged.mode=2; "
> + "Although device is wedged.\n");
> + return;
> + }
>
> - mutex_lock(&guc->submission_state.lock);
> - xa_for_each(&guc->submission_state.exec_queue_lookup, index, q)
> - if (xe_exec_queue_get_unless_zero(q))
> - set_exec_queue_wedged(q);
> - mutex_unlock(&guc->submission_state.lock);
> + mutex_lock(&guc->submission_state.lock);
> + xa_for_each(&guc->submission_state.exec_queue_lookup, index, q)
> + if (xe_exec_queue_get_unless_zero(q))
> + set_exec_queue_wedged(q);
> + mutex_unlock(&guc->submission_state.lock);
> + } else {
> + /* Forcefully kill any remaining exec queues, signal fences */
> + xe_guc_submit_stop(guc);
> + xe_guc_submit_pause_abort(guc);
This is basically the prerequisite[1] as we decided at the time, but
perhaps I failed to notice it. I'm wondering if we should also redirect
page faults to dummy page as per prerequisites section?
[1] https://lore.kernel.org/dri-devel/20250204070528.1919158-2-raag.jadav@intel.com/
Raag
next prev parent reply other threads:[~2025-12-13 7:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-12 23:34 [RFC PATCH 0/3] Attempt to fixup reset, wedge, unload corner cases Matthew Brost
2025-12-12 23:34 ` [RFC PATCH 1/3] drm/xe: Always kill exec queues in xe_guc_submit_pause_abort Matthew Brost
2025-12-12 23:34 ` [RFC PATCH 2/3] drm/xe: Forcefully tear down exec queues in GuC submit fini Matthew Brost
2025-12-12 23:34 ` [RFC PATCH 3/3] drm/xe: Trigger queue cleanup if not in wedged mode 2 Matthew Brost
2025-12-13 7:58 ` Raag Jadav [this message]
2025-12-18 21:13 ` Matthew Brost
2025-12-13 0:49 ` ✓ CI.KUnit: success for Attempt to fixup reset, wedge, unload corner cases Patchwork
2025-12-13 1:35 ` ✗ Xe.CI.BAT: failure " Patchwork
2025-12-13 22:08 ` ✗ 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=aT0clhiMQQvMk02_@black.igk.intel.com \
--to=raag.jadav@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.brost@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