From: sashiko-bot@kernel.org
To: "Anubhav Shelat" <ashelat@redhat.com>
Cc: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/pmu: convert i915_pmu->lock to raw_spinlock_t from spinlock_t
Date: Sat, 03 Oct 2026 01:33:16 +0000 [thread overview]
Message-ID: <20261003013316.E90DC1F0089A@smtp.kernel.org> (raw)
In-Reply-To: <20261002161137.297365-1-ashelat@redhat.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] i915/pmu: sleep in atomic (PREEMPT_RT) lock inversion in i915_pmu_gt_parked()
--
commit 4674b42fb5bd16ec1392c65ea4ec0e37639b3618
Author: Anubhav Shelat <ashelat@redhat.com>
drm/i915/pmu: convert i915_pmu->lock to raw_spinlock_t from spinlock_t
This commit converts the pmu lock from spinlock_t to raw_spinlock_t. The
conversion aims to avoid a sleep-in-atomic error on PREEMPT_RT kernels when
perf operations are called under a raw spinlock.
> diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c
> index 1c3bafda9c708..65771e54b9b51 100644
> --- a/drivers/gpu/drm/i915/i915_pmu.c
> +++ b/drivers/gpu/drm/i915/i915_pmu.c
[ ... ]
> @@ -304,7 +304,7 @@ void i915_pmu_gt_parked(struct intel_gt *gt)
> if (!pmu->registered)
> return;
>
> - spin_lock_irq(&pmu->lock);
> + raw_spin_lock_irq(&pmu->lock);
>
> park_rc6(gt);
[Severity: High]
Does this introduce a lock inversion on PREEMPT_RT kernels?
The patch converts pmu->lock to raw_spinlock_t, but i915_pmu_gt_parked() calls
into a path that acquires a regular spinlock_t while this raw lock is held:
i915_pmu_gt_parked()
raw_spin_lock_irq(&pmu->lock);
park_rc6()
__get_rc6()
intel_rc6_residency_ns()
spin_lock_irqsave(&uncore->lock, flags);
Because uncore->lock is still a standard spinlock_t, it can sleep on PREEMPT_RT
kernels. Acquiring it while holding the raw pmu->lock violates the lock
hierarchy and can cause a sleep-in-atomic panic during normal power management
operations.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261002161137.297365-1-ashelat@redhat.com?part=1
next prev parent reply other threads:[~2026-10-03 1:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-02 16:11 [PATCH] drm/i915/pmu: convert i915_pmu->lock to raw_spinlock_t from spinlock_t Anubhav Shelat
2026-10-02 17:47 ` ✓ i915.CI.BAT: success for " Patchwork
2026-10-03 1:33 ` sashiko-bot [this message]
2026-10-03 17:35 ` ✓ i915.CI.Full: " 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=20261003013316.E90DC1F0089A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=ashelat@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox