From: sashiko-bot@kernel.org
To: "Maarten Lankhorst" <dev@lankhorst.se>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v4 3/7] drm/i915/guc: Consider also RCU depth in busy loop.
Date: Mon, 06 Jul 2026 12:02:08 +0000 [thread overview]
Message-ID: <20260706120208.E33AF1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260706114823.752313-4-dev@lankhorst.se>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Looping with IRQs disabled causes soft-deadlocks and CT buffer breakage because the G2H draining tasklet cannot run.
--
commit fa66d9f372062707343fef0e57e8f112f58ecabc
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
drm/i915/guc: Consider also RCU depth in busy loop.
This commit updates the not_atomic condition in intel_guc_send_busy_loop
to additionally check rcu_preempt_depth. This prevents RCU splats on
PREEMPT_RT systems where sleeping spinlocks are acquired, which would
cause in_atomic and irqs_disabled to report false.
> 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();
[Severity: High]
This isn't a bug introduced by this patch, but does spinning with IRQs
disabled here cause a soft-deadlock that breaks the GuC CT buffer?
If the G2H buffer fills up and intel_guc_send_nb returns -EBUSY, the code
enters a busy loop. If the caller acquired spinlocks that disabled IRQs,
not_atomic will evaluate to false, causing the loop to use cpu_relax
instead of sleeping.
Inside this process, has_room_nb is called, which attempts to drain the
credits by queuing a tasklet:
drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c:has_room_nb() {
...
tasklet_hi_schedule(&ct->receive_tasklet);
...
}
This schedules the tasklet on the local CPU's tasklet list and sets
TASKLET_STATE_SCHED. However, because the local CPU is spinning in
cpu_relax with IRQs disabled, softirqs will never run.
Since the tasklet is pinned to the local deadlocked CPU, other CPUs
cannot drain the buffer even if they receive the GuC hard interrupt.
The G2H buffer never drains, and after 1.5 seconds, ct_deadlocked
returns true, permanently breaking the CT buffer.
>
> /*
> * FIXME: Have caller pass in if we are in an atomic context to avoid
> * using in_atomic() as it doesn't work for all configs (e.g. PREEMPT).
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260706114823.752313-1-dev@lankhorst.se?part=3
next prev parent reply other threads:[~2026-07-06 12:02 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 11:48 [PATCH v4 0/7] drm/i915: All fixes to make i915 work well with PREEMPT_RT Maarten Lankhorst
2026-07-06 11:48 ` [PATCH v4 1/7] drm/i915/gt: Use spin_lock_irq() instead of local_irq_disable() + spin_lock() Maarten Lankhorst
2026-07-06 12:03 ` sashiko-bot
2026-07-06 11:48 ` [PATCH v4 2/7] drm/i915: Drop the irqs_disabled() check Maarten Lankhorst
2026-07-06 11:48 ` [PATCH v4 3/7] drm/i915/guc: Consider also RCU depth in busy loop Maarten Lankhorst
2026-07-06 12:02 ` sashiko-bot [this message]
2026-07-06 11:48 ` [PATCH v4 4/7] drm/i915/gt: Fix selftests on PREEMPT_RT Maarten Lankhorst
2026-07-06 11:56 ` sashiko-bot
2026-07-06 11:48 ` [PATCH v4 5/7] drm/i915/gt: Set stop_timeout() correctly on PREEMPT-RT Maarten Lankhorst
2026-07-06 11:48 ` [PATCH v4 6/7] drm/i915: Use sleeping selftests for igt_atomic on PREEMPT_RT Maarten Lankhorst
2026-07-06 11:48 ` [PATCH v4 7/7] drm/i915/gt: Use signalers_lock to prevent starvation of irq_work Maarten Lankhorst
2026-07-06 12:04 ` sashiko-bot
2026-07-06 12:20 ` [PATCH v4 0/7] drm/i915: All fixes to make i915 work well with PREEMPT_RT Sebastian Andrzej Siewior
2026-07-06 12:51 ` Maarten Lankhorst
2026-07-06 14:49 ` ✗ i915.CI.BAT: failure for drm/i915: All fixes to make i915 work well with PREEMPT_RT. (rev4) Patchwork
2026-07-07 2:39 ` ✓ i915.CI.BAT: success for drm/i915: All fixes to make i915 work well with PREEMPT_RT. (rev5) Patchwork
2026-07-07 9:58 ` ✗ i915.CI.Full: failure " 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=20260706120208.E33AF1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dev@lankhorst.se \
--cc=dri-devel@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.