From: Maarten Lankhorst <dev@lankhorst.se>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
Tvrtko Ursulin <tursulin@ursulin.net>,
intel-gfx@lists.freedesktop.org
Cc: "John B. Wyatt IV" <jwyatt@redhat.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
Maarten Lankhorst <dev@lankhorst.se>
Subject: [PATCH v5 3/6] drm/i915/guc: Consider also RCU depth in busy loop.
Date: Wed, 23 Sep 2026 13:15:22 +0200 [thread overview]
Message-ID: <20260923111518.310430-11-dev@lankhorst.se> (raw)
In-Reply-To: <20260923111518.310430-8-dev@lankhorst.se>
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
intel_guc_send_busy_loop() looks at in_atomic() and irqs_disabled() to
decide if it should busy-spin while waiting or if it may sleep.
Both checks will report false on PREEMPT_RT if sleeping spinlocks are
acquired leading to RCU splats while the function sleeps.
Check also if RCU has been disabled.
Reported-by: "John B. Wyatt IV" <jwyatt@redhat.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
---
drivers/gpu/drm/i915/gt/uc/intel_guc.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
index 053780f562c1a..b25fa8f4dc4bd 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc.h
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
@@ -362,7 +362,7 @@ static inline int intel_guc_send_busy_loop(struct intel_guc *guc,
{
int err;
unsigned int sleep_period_ms = 1;
- bool not_atomic = !in_atomic() && !irqs_disabled();
+ bool not_atomic = !in_atomic() && !irqs_disabled() && !rcu_preempt_depth();
/*
* FIXME: Have caller pass in if we are in an atomic context to avoid
--
2.55.0
next prev parent reply other threads:[~2026-09-23 11:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 11:15 [PATCH v5 0/6] drm/i915: Most fixes to make i915 work well with PREEMPT_RT Maarten Lankhorst
2026-09-23 11:15 ` [PATCH v5 1/6] drm/i915/gt: Use spin_lock_irq() instead of local_irq_disable() + spin_lock() Maarten Lankhorst
2026-09-23 11:15 ` [PATCH v5 2/6] drm/i915: Drop the irqs_disabled() check Maarten Lankhorst
2026-09-23 11:15 ` Maarten Lankhorst [this message]
2026-09-23 11:15 ` [PATCH v5 4/6] drm/i915/gt: Fix selftests on PREEMPT_RT Maarten Lankhorst
2026-09-23 14:26 ` Sebastian Andrzej Siewior
2026-09-23 11:15 ` [PATCH v5 5/6] drm/i915/gt: Set stop_timeout() correctly on PREEMPT-RT Maarten Lankhorst
2026-09-23 14:27 ` Sebastian Andrzej Siewior
2026-09-23 11:15 ` [PATCH v5 6/6] drm/i915: Use sleeping selftests for igt_atomic on PREEMPT_RT Maarten Lankhorst
2026-09-23 11:28 ` sashiko-bot
2026-09-23 14:27 ` Sebastian Andrzej Siewior
2026-09-23 12:55 ` ✓ i915.CI.BAT: success for drm/i915: Most fixes to make i915 work well with PREEMPT_RT Patchwork
2026-09-23 14:27 ` [PATCH v5 0/6] " Sebastian Andrzej Siewior
2026-09-24 6:30 ` ✓ i915.CI.Full: success for " 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=20260923111518.310430-11-dev@lankhorst.se \
--to=dev@lankhorst.se \
--cc=bigeasy@linutronix.de \
--cc=intel-gfx@lists.freedesktop.org \
--cc=joonas.lahtinen@linux.intel.com \
--cc=jwyatt@redhat.com \
--cc=rodrigo.vivi@intel.com \
--cc=tursulin@ursulin.net \
/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