All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Maarten Lankhorst" <dev@lankhorst.se>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 4/4] drm/i915/display: Make set_pipeconf use the fw variants
Date: Thu, 02 Jul 2026 08:19:11 +0000	[thread overview]
Message-ID: <20260702081912.6C5591F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260702080346.431508-5-dev@lankhorst.se>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] vlv_atomic_update_fifo() takes a sleepable spinlock (uncore->lock) inside a hardware-interrupt-disabled critical section, leading to a 'sleeping function called from invalid context' BUG on PREEMPT_RT.
--

commit 5a85aa91d02b113ff09052cce4d68e8a6b54e2ce
Author: Maarten Lankhorst <dev@lankhorst.se>

drm/i915/display: Make set_pipeconf use the fw variants

This commit changes i9xx_set_pipeconf() and ilk_set_pipeconf() to use the
_fw variants of register read/write functions. This prevents sleepable locks
from being taken inside the interrupt-disabled critical section, which was
causing a BUG on PREEMPT_RT.

> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index f5dac380aa7ff..deb93d26e0e94 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -3030,8 +3030,9 @@ void i9xx_set_pipeconf(const struct intel_crtc_state *crtc_state)
>  
>  	val |= TRANSCONF_FRAME_START_DELAY(crtc_state->framestart_delay - 1);
>  
> -	intel_de_write(display, TRANSCONF(display, cpu_transcoder), val);
> -	intel_de_posting_read(display, TRANSCONF(display, cpu_transcoder));
> +	intel_de_write_fw(display, TRANSCONF(display, cpu_transcoder), val);
> +	/* posting read */
> +	intel_de_read_fw(display, TRANSCONF(display, cpu_transcoder));
>  }

[Severity: High]
This isn't a bug introduced by this patch, but does the explicit acquisition
of a sleepable spinlock inside an interrupt-disabled critical section in
vlv_atomic_update_fifo() violate PREEMPT_RT locking rules?

drivers/gpu/drm/i915/display/i9xx_wm.c:vlv_atomic_update_fifo() {
	...
	/*
	 * intel_pipe_update_start() has already disabled interrupts
	 * for us, so a plain spin_lock() is sufficient here.
	 */
	spin_lock(&uncore->lock);
	...
}

Taking a standard spinlock (which acts as a sleeping rt_mutex on PREEMPT_RT)
after local interrupts have been disabled causes a kernel BUG splat 'sleeping
function called from invalid context'.

The vblank evasion critical section initiated by intel_pipe_update_start()
disables local interrupts. Inside this critical section,
commit_pipe_pre_planes() calls intel_atomic_update_watermarks(), which on
VLV/CHV maps to vlv_atomic_update_fifo(). This function explicitly acquires
spin_lock(&uncore->lock).

Since this patch fixes the same locking violation in i9xx_set_pipeconf()
and ilk_set_pipeconf() by using the _fw variants, is it possible this
instance in the exact same critical section was missed?

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260702080346.431508-1-dev@lankhorst.se?part=4

  reply	other threads:[~2026-07-02  8:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-02  8:03 [PATCH 0/4] drm/intel/display: Remove forcewake during pipe updates Maarten Lankhorst
2026-07-02  8:03 ` [PATCH 1/4] drm/i915/display: Make icl_dsi_frame_update use _fw too Maarten Lankhorst
2026-07-02  8:27   ` Jani Nikula
2026-07-02  8:03 ` [PATCH 2/4] drm/i915/display: Use intel_de_read/write_fw in colorops Maarten Lankhorst
2026-07-02  8:28   ` Jani Nikula
2026-07-02  8:03 ` [PATCH 3/4] drm/i915/display: Use intel_de_write_fw in intel_pipe_fastset Maarten Lankhorst
2026-07-02  8:40   ` sashiko-bot
2026-07-02  8:44   ` Jani Nikula
2026-07-02 11:29     ` Maarten Lankhorst
2026-07-02  8:03 ` [PATCH 4/4] drm/i915/display: Make set_pipeconf use the fw variants Maarten Lankhorst
2026-07-02  8:19   ` sashiko-bot [this message]
2026-07-02  8:32 ` ✗ CI.checkpatch: warning for drm/intel/display: Remove forcewake during pipe updates Patchwork
2026-07-02  8:34 ` ✓ CI.KUnit: success " Patchwork
2026-07-02  9:16 ` ✓ Xe.CI.BAT: " Patchwork
2026-07-02 11:03 ` ✓ i915.CI.BAT: " Patchwork
2026-07-03  2:37 ` ✓ Xe.CI.FULL: " Patchwork
2026-07-03  4:11 ` ✗ 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=20260702081912.6C5591F000E9@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.