From: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
To: Shuicheng Lin <shuicheng.lin@intel.com>,
<intel-xe@lists.freedesktop.org>
Cc: Matthew Brost <matthew.brost@intel.com>
Subject: Re: [PATCH] drm/xe/guc: Destroy LR exec queue directly if GuC is not running
Date: Wed, 15 Oct 2025 11:02:19 -0700 [thread overview]
Message-ID: <5dd62ebb-ff5c-4ab7-a7d8-88a191105490@intel.com> (raw)
In-Reply-To: <20251014033646.1619865-2-shuicheng.lin@intel.com>
On 10/13/2025 8:36 PM, Shuicheng Lin wrote:
> During LR exec queue cleanup, if the GuC firmware is not running,
> the driver cannot communicate with the GuC to properly deregister
> the exec queue. In this case, directly destroy the exec queue
> instead of attempting deregistration.
>
> This prevents schedule disable failure and GuC ID resource leaks as
> below dmesg log:
> "
> [ 50.242564] pci 0000:03:00.0: [drm] GT0: Schedule disable failed to respond, guc_id=2
> [ 50.242568] ------------[ cut here ]------------
> [ 50.242584] pci 0000:03:00.0: [drm] Assertion `ret` failed!
> ...
> [ 50.244942] pci 0000:03:00.0: [drm] *ERROR* GT0: GUC ID manager unclean (1/65535)
> [ 50.244970] pci 0000:03:00.0: [drm] GT0: total 65535
> [ 50.245002] pci 0000:03:00.0: [drm] GT0: used 1
> [ 50.245032] pci 0000:03:00.0: [drm] GT0: range 2..2 (1)
> "
>
> Fixes: 8ae8a2e8dd21 ("drm/xe: Long running job update")
> Cc: Matthew Brost <matthew.brost@intel.com>
> Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
> ---
> drivers/gpu/drm/xe/xe_guc_submit.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
> index 0ef67d3523a7..d2dfbdc82920 100644
> --- a/drivers/gpu/drm/xe/xe_guc_submit.c
> +++ b/drivers/gpu/drm/xe/xe_guc_submit.c
> @@ -47,6 +47,8 @@
> #include "xe_uc_fw.h"
> #include "xe_vm.h"
>
> +static void __guc_exec_queue_destroy(struct xe_guc *guc, struct xe_exec_queue *q);
> +
> static struct xe_guc *
> exec_queue_to_guc(struct xe_exec_queue *q)
> {
> @@ -1060,10 +1062,15 @@ static void xe_guc_exec_queue_lr_cleanup(struct work_struct *w)
> * state.
> */
> if (!wedged && exec_queue_registered(q) && !exec_queue_destroyed(q)) {
> - struct xe_guc *guc = exec_queue_to_guc(q);
> int ret;
>
> set_exec_queue_banned(q);
> + /* If GuC is not running, just destroy the exec queue as we can't communicate with it */
> + if (!xe_uc_fw_is_running(&guc->fw)) {
This doesn't cover the case where the GuC is reset after we send the
message but before we get a reply. There is also already a check below
and inside disable_scheduling_deregister to cover the case where the GuC
is not responding (guc_read_stopped()), which should also cover the case
where the GuC has already been reset. That flow is probably not working
as expected, so it might be worth having a look at fixing that instead.
Daniele
> + __guc_exec_queue_destroy(guc, q);
> + goto skip_deregister;
> + }
> +
> disable_scheduling_deregister(guc, q);
>
> /*
> @@ -1088,6 +1095,7 @@ static void xe_guc_exec_queue_lr_cleanup(struct work_struct *w)
> }
> }
>
> +skip_deregister:
> if (!exec_queue_killed(q) && !xe_lrc_ring_is_idle(q->lrc[0]))
> xe_devcoredump(q, NULL, "LR job cleanup, guc_id=%d", q->guc->id);
>
next prev parent reply other threads:[~2025-10-15 18:02 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-14 3:36 [PATCH] drm/xe/guc: Destroy LR exec queue directly if GuC is not running Shuicheng Lin
2025-10-14 4:28 ` ✗ CI.checkpatch: warning for " Patchwork
2025-10-14 4:29 ` ✓ CI.KUnit: success " Patchwork
2025-10-14 5:08 ` ✓ Xe.CI.BAT: " Patchwork
2025-10-14 12:53 ` ✗ Xe.CI.Full: failure " Patchwork
2025-10-15 17:07 ` [PATCH] " Lin, Shuicheng
2025-10-15 18:01 ` Summers, Stuart
2025-10-15 18:11 ` Lin, Shuicheng
2025-10-15 18:15 ` Summers, Stuart
2025-10-15 18:02 ` Daniele Ceraolo Spurio [this message]
2025-10-15 21:07 ` Lin, Shuicheng
2025-10-16 3:24 ` Matthew Brost
2025-10-16 14:51 ` Lin, Shuicheng
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=5dd62ebb-ff5c-4ab7-a7d8-88a191105490@intel.com \
--to=daniele.ceraolospurio@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