* [PATCH] drm/i915/alpm: Track the configured transcoder lifetime
@ 2026-11-20 11:24 Jouni Högander
2026-11-20 14:59 ` Jani Nikula
0 siblings, 1 reply; 2+ messages in thread
From: Jouni Högander @ 2026-11-20 11:24 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: Jouni Högander, Animesh Manna, stable
ALPM disable can access a stale transcoder when ALPM was not configured
for the current modeset, causing unclaimed register accesses during
pipe teardown.
Record the transcoder only when programming ALPM and invalidate it
after disable. Check it under the ALPM lock to avoid register accesses
on repeated or unconfigured disables.
Fixes: 504766382edb ("drm/i915/lobf: Disintegrate alpm_disable from psr_disable")
Cc: Animesh Manna <animesh.manna@intel.com>
Cc: <stable@vger.kernel.org> # v6.16+
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
---
drivers/gpu/drm/i915/display/intel_alpm.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c b/drivers/gpu/drm/i915/display/intel_alpm.c
index f54b29e193ee9..105006ca6be7f 100644
--- a/drivers/gpu/drm/i915/display/intel_alpm.c
+++ b/drivers/gpu/drm/i915/display/intel_alpm.c
@@ -46,6 +46,7 @@ bool intel_alpm_is_alpm_aux_less(struct intel_dp *intel_dp,
void intel_alpm_init(struct intel_dp *intel_dp)
{
mutex_init(&intel_dp->alpm.lock);
+ intel_dp->alpm.transcoder = INVALID_TRANSCODER;
}
static int get_silence_period_symbols(const struct intel_crtc_state *crtc_state)
@@ -549,6 +550,7 @@ static void lnl_alpm_configure(struct intel_dp *intel_dp,
alpm_ctl |= ALPM_CTL_ALPM_ENTRY_CHECK(crtc_state->alpm_state.check_entry_lines);
intel_de_write(display, ALPM_CTL(display, cpu_transcoder), alpm_ctl);
+ intel_dp->alpm.transcoder = cpu_transcoder;
mutex_unlock(&intel_dp->alpm.lock);
}
@@ -556,7 +558,6 @@ void intel_alpm_configure(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state)
{
lnl_alpm_configure(intel_dp, crtc_state);
- intel_dp->alpm.transcoder = crtc_state->cpu_transcoder;
}
void intel_alpm_port_configure(struct intel_dp *intel_dp,
@@ -733,17 +734,23 @@ void intel_alpm_lobf_debugfs_add(struct intel_connector *connector)
void intel_alpm_disable(struct intel_dp *intel_dp)
{
struct intel_display *display = to_intel_display(intel_dp);
- enum transcoder cpu_transcoder = intel_dp->alpm.transcoder;
+ enum transcoder cpu_transcoder;
if (DISPLAY_VER(display) < 20 || !intel_dp->alpm_dpcd)
return;
mutex_lock(&intel_dp->alpm.lock);
+ cpu_transcoder = intel_dp->alpm.transcoder;
+ if (cpu_transcoder == INVALID_TRANSCODER)
+ goto unlock;
+
intel_de_rmw(display, ALPM_CTL(display, cpu_transcoder),
ALPM_CTL_ALPM_ENABLE | ALPM_CTL_LOBF_ENABLE, 0);
+ intel_dp->alpm.transcoder = INVALID_TRANSCODER;
drm_dbg_kms(display->drm, "Disabling ALPM\n");
+unlock:
mutex_unlock(&intel_dp->alpm.lock);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/i915/alpm: Track the configured transcoder lifetime
2026-11-20 11:24 [PATCH] drm/i915/alpm: Track the configured transcoder lifetime Jouni Högander
@ 2026-11-20 14:59 ` Jani Nikula
0 siblings, 0 replies; 2+ messages in thread
From: Jani Nikula @ 2026-11-20 14:59 UTC (permalink / raw)
To: Jouni Högander, intel-gfx, intel-xe
Cc: Jouni Högander, Animesh Manna, stable
On Fri, 20 Nov 2026, Jouni Högander <jouni.hogander@intel.com> wrote:
> ALPM disable can access a stale transcoder when ALPM was not configured
> for the current modeset, causing unclaimed register accesses during
> pipe teardown.
>
> Record the transcoder only when programming ALPM and invalidate it
> after disable. Check it under the ALPM lock to avoid register accesses
> on repeated or unconfigured disables.
>
> Fixes: 504766382edb ("drm/i915/lobf: Disintegrate alpm_disable from psr_disable")
> Cc: Animesh Manna <animesh.manna@intel.com>
> Cc: <stable@vger.kernel.org> # v6.16+
> Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_alpm.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c b/drivers/gpu/drm/i915/display/intel_alpm.c
> index f54b29e193ee9..105006ca6be7f 100644
> --- a/drivers/gpu/drm/i915/display/intel_alpm.c
> +++ b/drivers/gpu/drm/i915/display/intel_alpm.c
> @@ -46,6 +46,7 @@ bool intel_alpm_is_alpm_aux_less(struct intel_dp *intel_dp,
> void intel_alpm_init(struct intel_dp *intel_dp)
> {
> mutex_init(&intel_dp->alpm.lock);
> + intel_dp->alpm.transcoder = INVALID_TRANSCODER;
> }
>
> static int get_silence_period_symbols(const struct intel_crtc_state *crtc_state)
> @@ -549,6 +550,7 @@ static void lnl_alpm_configure(struct intel_dp *intel_dp,
> alpm_ctl |= ALPM_CTL_ALPM_ENTRY_CHECK(crtc_state->alpm_state.check_entry_lines);
>
> intel_de_write(display, ALPM_CTL(display, cpu_transcoder), alpm_ctl);
> + intel_dp->alpm.transcoder = cpu_transcoder;
> mutex_unlock(&intel_dp->alpm.lock);
> }
>
> @@ -556,7 +558,6 @@ void intel_alpm_configure(struct intel_dp *intel_dp,
> const struct intel_crtc_state *crtc_state)
> {
> lnl_alpm_configure(intel_dp, crtc_state);
> - intel_dp->alpm.transcoder = crtc_state->cpu_transcoder;
> }
>
> void intel_alpm_port_configure(struct intel_dp *intel_dp,
> @@ -733,17 +734,23 @@ void intel_alpm_lobf_debugfs_add(struct intel_connector *connector)
> void intel_alpm_disable(struct intel_dp *intel_dp)
> {
> struct intel_display *display = to_intel_display(intel_dp);
> - enum transcoder cpu_transcoder = intel_dp->alpm.transcoder;
> + enum transcoder cpu_transcoder;
>
> if (DISPLAY_VER(display) < 20 || !intel_dp->alpm_dpcd)
> return;
>
> mutex_lock(&intel_dp->alpm.lock);
>
> + cpu_transcoder = intel_dp->alpm.transcoder;
> + if (cpu_transcoder == INVALID_TRANSCODER)
> + goto unlock;
> +
> intel_de_rmw(display, ALPM_CTL(display, cpu_transcoder),
> ALPM_CTL_ALPM_ENABLE | ALPM_CTL_LOBF_ENABLE, 0);
> + intel_dp->alpm.transcoder = INVALID_TRANSCODER;
>
> drm_dbg_kms(display->drm, "Disabling ALPM\n");
> +unlock:
> mutex_unlock(&intel_dp->alpm.lock);
> }
--
Jani Nikula, Intel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-20 14:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 11:24 [PATCH] drm/i915/alpm: Track the configured transcoder lifetime Jouni Högander
2026-11-20 14:59 ` Jani Nikula
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox