From: Javier MV <javiermv@gmail.com>
To: intel-gfx@lists.freedesktop.org
Cc: Javier MV <javiermv@duck.com>,
jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com,
rodrigo.vivi@intel.com, tursulin@ursulin.net,
matthew.brost@intel.com, daniele.ceraolospurio@intel.com,
umesh.nerlige.ramappa@intel.com
Subject: [PATCH 2/2] drm/i915/guc: Don't unblock a banned context
Date: Tue, 10 Nov 2026 12:24:48 +0000 [thread overview]
Message-ID: <20261110122534.12989-3-javiermv@gmail.com> (raw)
In-Reply-To: <20261110122534.12989-1-javiermv@gmail.com>
From: Javier MV <javiermv@duck.com>
guc_context_cancel_request() blocks the context, skips the request and
unblocks the context again. If the context gets banned meanwhile (the
blocked request hits a GuC context reset), guc_context_revoke() finds
the schedule disable of the block still pending, so it only sets the
preemption timeout to 1 ms and leaves the cancellation to the schedule
disable done handler. That handler clears SCHED_STATE_BANNED, and then
guc_context_unblock() finds nothing in context_cant_unblock() that
stops it from enabling scheduling again.
GuC then runs a banned context with a 1 ms preemption timeout and
resets it again at the first preemption. Seen on ADL-P: the second
reset notification was ignored, GuC sent G2H messages the driver
rejected (action 0x6000, -EOPNOTSUPP), the rcs0 heartbeat stopped and
the whole GT was reset, which also kills every other client's work.
Also check intel_context_is_banned(), which stays set. The requests the
replay put back in the queue are then completed on resubmission, as for
any banned context.
Found and fixed with Claude Code (AI coding assistant); details in the
cover letter.
Fixes: 9888beaaf118 ("drm/i915/guc: Don't enable scheduling on a banned context, guc_id invalid, not registered")
Link: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/15301
Signed-off-by: Javier MV <javiermv@duck.com>
---
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
index 555ca8f..eb1d010 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
@@ -3182,7 +3182,12 @@ static bool context_cant_unblock(struct intel_context *ce)
{
lockdep_assert_held(&ce->guc_state.lock);
+ /*
+ * SCHED_STATE_BANNED alone isn't enough: the sched disable done
+ * handler clears it.
+ */
return (ce->guc_state.sched_state & SCHED_STATE_NO_UNBLOCK) ||
+ intel_context_is_banned(ce) ||
context_guc_id_invalid(ce) ||
!ctx_id_mapped(ce_to_guc(ce), ce->guc_id.id) ||
!intel_context_is_pinned(ce);
--
2.51.1
next prev parent reply other threads:[~2026-11-10 12:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 12:24 [PATCH 0/2] drm/i915/guc: Fix requests of a banned context never completing Javier MV
2026-11-10 12:24 ` [PATCH 1/2] drm/i915/guc: Complete all requests of a non-schedulable context Javier MV
2026-11-10 12:56 ` sashiko-bot
2026-11-10 12:24 ` Javier MV [this message]
2026-11-10 13:07 ` [PATCH 2/2] drm/i915/guc: Don't unblock a banned context sashiko-bot
2026-11-10 15:11 ` ✗ LGCI.VerificationFailed: failure for drm/i915/guc: Fix requests of a banned context never completing Patchwork
2026-11-11 15:29 ` [PATCH 0/2] " Javier MV
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=20261110122534.12989-3-javiermv@gmail.com \
--to=javiermv@gmail.com \
--cc=daniele.ceraolospurio@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=javiermv@duck.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=matthew.brost@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=tursulin@ursulin.net \
--cc=umesh.nerlige.ramappa@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