All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ville Syrjala" <ville.syrjala@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/de: Convert mmio.lock to raw spinlock
Date: Wed, 25 Nov 2026 16:43:44 +0000	[thread overview]
Message-ID: <sashiko-outbox-233772@kernel.org> (raw)
In-Reply-To: <20261125155831.17395-1-ville.syrjala@linux.intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] drm/i915/vblank: IRQ-unsafe raw_spin_lock() in
  intel_vblank_section_enter()
--

commit 8b5f59599d9077ae92b9dc93f4c4413fb415a8c7
Author: Ville Syrjälä <ville.syrjala@linux.intel.com>

drm/i915/de: Convert mmio.lock to raw spinlock

This commit converts display->mmio.lock from a spinlock_t to a
raw_spinlock_t so that display register accesses can be performed from
non-sleepable contexts such as tracepoints on PREEMPT_RT kernels.

> diff --git a/drivers/gpu/drm/i915/display/intel_vblank.c b/drivers/gpu/drm/i915/display/intel_vblank.c
> index 114ff43381b53..a9be8d4ad2dfe 100644
> --- a/drivers/gpu/drm/i915/display/intel_vblank.c
> +++ b/drivers/gpu/drm/i915/display/intel_vblank.c
> @@ -290,13 +290,13 @@ static int __intel_get_crtc_scanline(struct intel_crtc *crtc)
>  static void intel_vblank_section_enter(struct intel_display *display)
>  	__acquires(display->mmio.lock)
>  {
> -	spin_lock(&display->mmio.lock);
> +	raw_spin_lock(&display->mmio.lock);
>  }
>  
>  static void intel_vblank_section_exit(struct intel_display *display)
>  	__releases(display->mmio.lock)
>  {
> -	spin_unlock(&display->mmio.lock);
> +	raw_spin_unlock(&display->mmio.lock);
>  }
>  #else
>  static void intel_vblank_section_enter(struct intel_display *display)

[Severity: High]
Can intel_vblank_section_enter() acquire display->mmio.lock with hardware
interrupts enabled on PREEMPT_RT?

Unlike i915_get_crtc_scanoutpos() and intel_get_crtc_scanline(), which
call local_irq_save() before intel_vblank_section_enter(),
intel_crtc_update_active_timings() only acquires vblank_time_lock:

drivers/gpu/drm/i915/display/intel_vblank.c:intel_crtc_update_active_timings() {
	...
	spin_lock_irqsave(&display->drm->vblank_time_lock, irqflags);
	intel_vblank_section_enter(display);
	...
}

Because vblank_time_lock is a sleeping spinlock_t on PREEMPT_RT,
spin_lock_irqsave() does not disable local interrupts.  Acquiring the raw
display->mmio.lock without masking interrupts triggers a lockdep irq-usage
inversion warning and can self-deadlock if a hardirq or tracepoint on the
same CPU also takes display->mmio.lock.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261125155831.17395-1-ville.syrjala@linux.intel.com?part=1

  parent reply	other threads:[~2026-11-25 16:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 15:58 [PATCH] drm/i915/de: Convert mmio.lock to raw spinlock Ville Syrjala
2026-11-25 16:38 ` ✓ CI.KUnit: success for " Patchwork
2026-11-25 16:43 ` sashiko-bot [this message]
2026-11-25 17:26 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-25 18:44 ` ✓ i915.CI.BAT: " Patchwork
2026-11-25 20:28 ` [PATCH] " Jani Nikula
2026-11-26  1:12 ` ✓ Xe.CI.FULL: success for " Patchwork
2026-11-26 13:22 ` [PATCH v2] " Ville Syrjala
2026-11-26 17:57 ` ✗ CI.checkpatch: warning for drm/i915/de: Convert mmio.lock to raw spinlock (rev2) Patchwork
2026-11-26 17:59 ` ✓ CI.KUnit: success " Patchwork
2026-11-26 18:38 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-26 18:51 ` ✓ i915.CI.BAT: " Patchwork
2026-11-27  4:42 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-11-27 22:21 ` ✗ 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=sashiko-outbox-233772@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=ville.syrjala@linux.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 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.