Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
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 v3 2/2] drm/i915/guc: Don't unblock a non-schedulable context
Date: Mon, 16 Nov 2026 11:59:48 +0000	[thread overview]
Message-ID: <20261116115958.9499-3-javiermv@gmail.com> (raw)
In-Reply-To: <20261116115958.9499-1-javiermv@gmail.com>

From: Javier MV <javiermv@duck.com>

If a context is banned or revoked while guc_context_cancel_request() has
it blocked, guc_context_revoke() finds the block's schedule disable
pending and leaves the cancellation to its done handler, which clears
SCHED_STATE_BANNED. guc_context_unblock() then enables scheduling again.
GuC resets the context at the first preemption (1 ms timeout), the
second reset is ignored, and on ADL-P this ended in a full GT reset.

Also check intel_context_is_schedulable(), which stays false.

Found with the help of Claude Code.

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>
---
v3:
- Shorter commit message and comment (Rodrigo).

v2:
- Check !intel_context_is_schedulable() instead of
  intel_context_is_banned(): revoke takes the same path for exiting
  contexts (Sashiko).

 drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 2 ++
 1 file changed, 2 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 229fa0fd3714..8a3a39da4963 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
@@ -3183,7 +3183,9 @@ static bool context_cant_unblock(struct intel_context *ce)
 {
 	lockdep_assert_held(&ce->guc_state.lock);
 
+	/* The sched disable done handler clears SCHED_STATE_BANNED */
 	return (ce->guc_state.sched_state & SCHED_STATE_NO_UNBLOCK) ||
+		!intel_context_is_schedulable(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


  parent reply	other threads:[~2026-11-16 12:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 11:59 [PATCH v3 0/2] drm/i915/guc: Fix requests of a banned context never completing Javier MV
2026-11-16 11:59 ` [PATCH v3 1/2] drm/i915/guc: Complete all requests of a non-schedulable context Javier MV
2026-11-16 12:40   ` sashiko-bot
2026-11-16 11:59 ` Javier MV [this message]
2026-11-16 14:18 ` ✗ LGCI.VerificationFailed: failure for drm/i915/guc: Fix requests of a banned context never completing (rev3) 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=20261116115958.9499-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