From: sashiko-bot@kernel.org
To: "Maarten Lankhorst" <dev@lankhorst.se>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/4] drm/i915/display: Use intel_de_write_fw in intel_pipe_fastset
Date: Thu, 02 Jul 2026 08:40:22 +0000 [thread overview]
Message-ID: <20260702084023.29E691F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260702080346.431508-4-dev@lankhorst.se>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
New issues:
- [High] Missing Wakelock / DC State Hardware Hang
Pre-existing issues:
- [High] Sleeping in Atomic Context (Incomplete Fix)
--
commit b928342b55781fe54de15efd0d013221c43c3091
Author: Maarten Lankhorst <dev@lankhorst.se>
drm/i915/display: Use intel_de_write_fw in intel_pipe_fastset
This commit updates multiple display configuration functions to use the
_fw register write variants to bypass DMC wakelock acquisition. This is
intended to fix a sleep-in-atomic-context deadlock on PREEMPT_RT when
modifying display registers during vblank evasion.
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 5bc8e6ea10a50..f5dac380aa7ff 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
[ ... ]
> @@ -2607,14 +2607,14 @@ void intel_set_m_n(struct intel_display *display,
> intel_reg_t data_m_reg, intel_reg_t data_n_reg,
> intel_reg_t link_m_reg, intel_reg_t link_n_reg)
> {
> - intel_de_write(display, data_m_reg, TU_SIZE(m_n->tu) | m_n->data_m);
> - intel_de_write(display, data_n_reg, m_n->data_n);
> - intel_de_write(display, link_m_reg, m_n->link_m);
> + intel_de_write_fw(display, data_m_reg, TU_SIZE(m_n->tu) | m_n->data_m);
> + intel_de_write_fw(display, data_n_reg, m_n->data_n);
> + intel_de_write_fw(display, link_m_reg, m_n->link_m);
> /*
> * On BDW+ writing LINK_N arms the double buffered update
> * of all the M/N registers, so it must be written last.
> */
> - intel_de_write(display, link_n_reg, m_n->link_n);
> + intel_de_write_fw(display, link_n_reg, m_n->link_n);
[Severity: High]
Does using intel_de_write_fw() here risk writing to hardware while it is in a
deep sleep DC state?
When intel_set_m_n() is called asynchronously by intel_drrs_downclock_work()
through intel_drrs_set_refresh_rate_m_n():
drivers/gpu/drm/i915/display/intel_drrs.c:intel_drrs_set_refresh_rate_m_n() {
...
intel_cpu_transcoder_set_m1_n1(crtc, crtc->drrs.cpu_transcoder,
refresh_rate == DRRS_REFRESH_RATE_LOW ?
&crtc->drrs.m2_n2 : &crtc->drrs.m_n);
...
}
This async work runs when the display is idle and holds no outer DMC
wakelocks. Bypassing the implicit wakelock acquisition could lead to the
transcoder M/N registers being written without waking up the DMC,
potentially causing dropped writes or hardware hangs.
> }
>
> bool intel_cpu_transcoder_has_m2_n2(struct intel_display *display,
[ ... ]
> diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c b/drivers/gpu/drm/i915/display/intel_vrr.c
> index bffbdee76ee1c..5b09a17185b9c 100644
> --- a/drivers/gpu/drm/i915/display/intel_vrr.c
> +++ b/drivers/gpu/drm/i915/display/intel_vrr.c
[ ... ]
> @@ -923,8 +923,8 @@ static void intel_vrr_tg_enable(const struct intel_crtc_state *crtc_state,
> enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
> u32 vrr_ctl;
>
> - intel_de_write(display, TRANS_PUSH(display, cpu_transcoder),
> - trans_vrr_push(crtc_state, false));
> + intel_de_write_fw(display, TRANS_PUSH(display, cpu_transcoder),
> + trans_vrr_push(crtc_state, false));
>
> vrr_ctl = VRR_CTL_VRR_ENABLE | trans_vrr_ctl(crtc_state);
>
[Severity: High]
This is a pre-existing issue, but while you are converting these functions to
avoid sleeping in atomic context, do intel_vrr_set_transcoder_timings(),
intel_vrr_set_vrr_timings(), and intel_vrr_enable_dc_balancing() also need
to be converted to use the _fw variants?
They are called during the vblank evasion loop (which disables interrupts and
preemption) and still use intel_de_write(), which acquires the DMC wakelock
and uncore spinlock, both of which can sleep on PREEMPT_RT:
intel_de_write(display, TRANS_VRR_CTL(display, cpu_transcoder),
trans_vrr_ctl(crtc_state));
Will leaving these unconverted result in the same sleep-in-atomic-context
deadlocks during display mode sets or fastsets with VRR enabled?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260702080346.431508-1-dev@lankhorst.se?part=3
next prev parent reply other threads:[~2026-07-02 8:40 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 [this message]
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
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=20260702084023.29E691F00A3A@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.