* [PATCH] drm/i915/display: guard intel_alpm_get_error() against non-ALPM sinks
@ 2026-06-11 12:54 Stephen J. Fuhry
2026-06-11 13:17 ` Hogander, Jouni
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Stephen J. Fuhry @ 2026-06-11 12:54 UTC (permalink / raw)
To: intel-gfx
Cc: Jani Nikula, Rodrigo Vivi, Jouni Högander, Animesh Manna,
intel-xe, dri-devel, Stephen J . Fuhry
intel_alpm_get_error() unconditionally reads DP_RECEIVER_ALPM_STATUS via
AUX from any DP connection that receives a short-pulse interrupt. However,
alpm_dpcd is only populated by intel_edp_init_dpcd(), so it is zero for
all external (non-eDP) DP and DP-MST connections. On such connections the
AUX read fails, producing a spurious
[drm] *ERROR* Error reading ALPM status
and setting sink_alpm_error = true, which is then visible in the ALPM
debug output even on hardware that never enabled ALPM.
intel_alpm_disable() already has the same guard (DISPLAY_VER check plus
!intel_dp->alpm_dpcd); extend the same logic to intel_alpm_get_error() so
it returns early without attempting the AUX transaction when ALPM is not
supported by the sink.
Reproducer: ThinkPad T14 Gen1 (Alder Lake-P / i915 DISPLAY_VER 12) docked
via Lenovo ThinkPad USB-C Dock Gen2 with external DP-MST monitors. On
every DPMS wake the error fires once on the dock's upstream DP port.
Fixes: 2063174c22da ("drm/i915/lobf: Check for sink error and disable LOBF")
Signed-off-by: Stephen J. Fuhry <fuhrysteve@gmail.com>
---
drivers/gpu/drm/i915/display/intel_alpm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c b/drivers/gpu/drm/i915/display/intel_alpm.c
index a7350ce8e716..4bb0c00741c4 100644
--- a/drivers/gpu/drm/i915/display/intel_alpm.c
+++ b/drivers/gpu/drm/i915/display/intel_alpm.c
@@ -611,6 +611,9 @@ bool intel_alpm_get_error(struct intel_dp *intel_dp)
u8 val;
int r;
+ if (!intel_dp->alpm_dpcd)
+ return false;
+
r = drm_dp_dpcd_readb(aux, DP_RECEIVER_ALPM_STATUS, &val);
if (r != 1) {
drm_err(display->drm, "Error reading ALPM status\n");
--
2.39.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/i915/display: guard intel_alpm_get_error() against non-ALPM sinks
2026-06-11 12:54 [PATCH] drm/i915/display: guard intel_alpm_get_error() against non-ALPM sinks Stephen J. Fuhry
@ 2026-06-11 13:17 ` Hogander, Jouni
2026-06-11 14:49 ` [PATCH] drm/i915/display: fix ALPM error handling in psr_alpm_check() Stephen J. Fuhry
2026-06-12 13:22 ` ✗ LGCI.VerificationFailed: failure for drm/i915/display: guard intel_alpm_get_error() against non-ALPM sinks (rev2) Patchwork
2 siblings, 0 replies; 6+ messages in thread
From: Hogander, Jouni @ 2026-06-11 13:17 UTC (permalink / raw)
To: fuhrysteve@gmail.com, intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org, Vivi, Rodrigo, Manna, Animesh,
jani.nikula@linux.intel.com, dri-devel@lists.freedesktop.org
On Thu, 2026-06-11 at 08:54 -0400, Stephen J. Fuhry wrote:
> intel_alpm_get_error() unconditionally reads DP_RECEIVER_ALPM_STATUS
> via
> AUX from any DP connection that receives a short-pulse interrupt.
> However,
> alpm_dpcd is only populated by intel_edp_init_dpcd(), so it is zero
> for
> all external (non-eDP) DP and DP-MST connections. On such
> connections the
> AUX read fails, producing a spurious
>
> [drm] *ERROR* Error reading ALPM status
>
> and setting sink_alpm_error = true, which is then visible in the ALPM
> debug output even on hardware that never enabled ALPM.
>
> intel_alpm_disable() already has the same guard (DISPLAY_VER check
> plus
> !intel_dp->alpm_dpcd); extend the same logic to
> intel_alpm_get_error() so
> it returns early without attempting the AUX transaction when ALPM is
> not
> supported by the sink.
>
> Reproducer: ThinkPad T14 Gen1 (Alder Lake-P / i915 DISPLAY_VER 12)
> docked
> via Lenovo ThinkPad USB-C Dock Gen2 with external DP-MST monitors.
> On
> every DPMS wake the error fires once on the dock's upstream DP port.
>
> Fixes: 2063174c22da ("drm/i915/lobf: Check for sink error and disable
> LOBF")
> Signed-off-by: Stephen J. Fuhry <fuhrysteve@gmail.com>
As intel_alpm.c is not supporting non-eDP ATM for now I think your fix
proposal is ok:
Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_alpm.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c
> b/drivers/gpu/drm/i915/display/intel_alpm.c
> index a7350ce8e716..4bb0c00741c4 100644
> --- a/drivers/gpu/drm/i915/display/intel_alpm.c
> +++ b/drivers/gpu/drm/i915/display/intel_alpm.c
> @@ -611,6 +611,9 @@ bool intel_alpm_get_error(struct intel_dp
> *intel_dp)
> u8 val;
> int r;
>
> + if (!intel_dp->alpm_dpcd)
> + return false;
> +
> r = drm_dp_dpcd_readb(aux, DP_RECEIVER_ALPM_STATUS, &val);
> if (r != 1) {
> drm_err(display->drm, "Error reading ALPM
> status\n");
> --
> 2.39.5
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] drm/i915/display: fix ALPM error handling in psr_alpm_check()
2026-06-11 12:54 [PATCH] drm/i915/display: guard intel_alpm_get_error() against non-ALPM sinks Stephen J. Fuhry
2026-06-11 13:17 ` Hogander, Jouni
@ 2026-06-11 14:49 ` Stephen J. Fuhry
2026-06-11 14:59 ` Hogander, Jouni
2026-06-11 15:45 ` Stephen J. Fuhry
2026-06-12 13:22 ` ✗ LGCI.VerificationFailed: failure for drm/i915/display: guard intel_alpm_get_error() against non-ALPM sinks (rev2) Patchwork
2 siblings, 2 replies; 6+ messages in thread
From: Stephen J. Fuhry @ 2026-06-11 14:49 UTC (permalink / raw)
To: intel-gfx
Cc: Jani Nikula, Rodrigo Vivi, Jouni Högander, Animesh Manna,
intel-xe, dri-devel, Stephen J . Fuhry, sashiko AI review
intel_dp_short_pulse() calls intel_psr_short_pulse() before the direct
intel_alpm_get_error() check. For PSR2-enabled panels, intel_psr_short_pulse()
calls psr_alpm_check(), which reads and clears DP_ALPM_LOCK_TIMEOUT_ERROR via
intel_alpm_get_error(). The subsequent direct call in intel_dp_short_pulse()
then reads zero and skips calling intel_alpm_disable() and setting
sink_alpm_error, leaving LOBF potentially enabled despite the ALPM error.
Fix this by having psr_alpm_check() also call intel_alpm_disable() and set
sink_alpm_error when it handles an ALPM error. This mirrors what the direct
call in intel_dp_short_pulse() would have done, ensuring correct cleanup
regardless of which code path consumes the error bit first.
intel_alpm_disable() is already called under psr->lock from
intel_psr_disable_locked() for the Panel Replay path, so the lock ordering
is established and safe.
Suggested-by: sashiko AI review <sashiko-bot@kernel.org>
Fixes: 2063174c22da ("drm/i915/lobf: Check for sink error and disable LOBF")
Signed-off-by: Stephen J. Fuhry <fuhrysteve@gmail.com>
---
drivers/gpu/drm/i915/display/intel_psr.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index 9382ad1e01d8..0701c8b94aa2 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -3869,6 +3869,8 @@ static void psr_alpm_check(struct intel_dp *intel_dp)
if (intel_alpm_get_error(intel_dp)) {
intel_psr_disable_locked(intel_dp);
psr->sink_not_reliable = true;
+ intel_alpm_disable(intel_dp);
+ intel_dp->alpm.sink_alpm_error = true;
}
}
--
2.39.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/i915/display: fix ALPM error handling in psr_alpm_check()
2026-06-11 14:49 ` [PATCH] drm/i915/display: fix ALPM error handling in psr_alpm_check() Stephen J. Fuhry
@ 2026-06-11 14:59 ` Hogander, Jouni
2026-06-11 15:45 ` Stephen J. Fuhry
1 sibling, 0 replies; 6+ messages in thread
From: Hogander, Jouni @ 2026-06-11 14:59 UTC (permalink / raw)
To: fuhrysteve@gmail.com, intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org, Vivi, Rodrigo, Manna, Animesh,
jani.nikula@linux.intel.com, dri-devel@lists.freedesktop.org,
sashiko-bot@kernel.org
On Thu, 2026-06-11 at 10:49 -0400, Stephen J. Fuhry wrote:
> intel_dp_short_pulse() calls intel_psr_short_pulse() before the
> direct
> intel_alpm_get_error() check. For PSR2-enabled panels,
> intel_psr_short_pulse()
> calls psr_alpm_check(), which reads and clears
> DP_ALPM_LOCK_TIMEOUT_ERROR via
> intel_alpm_get_error(). The subsequent direct call in
> intel_dp_short_pulse()
> then reads zero and skips calling intel_alpm_disable() and setting
> sink_alpm_error, leaving LOBF potentially enabled despite the ALPM
> error.
>
> Fix this by having psr_alpm_check() also call intel_alpm_disable()
> and set
> sink_alpm_error when it handles an ALPM error. This mirrors what the
> direct
> call in intel_dp_short_pulse() would have done, ensuring correct
> cleanup
> regardless of which code path consumes the error bit first.
>
> intel_alpm_disable() is already called under psr->lock from
> intel_psr_disable_locked() for the Panel Replay path, so the lock
> ordering
> is established and safe.
This one we don't need. LOBF can't be enabled while PSR2 is enabled. If
ALPM error gets triggered when PSR2 is enabled -> PSR2 is disabled.
After that LOBF might be used. If there is a problem with LOBF then
ALPM error is supposed to get triggered again and then LOBF is
disabled.
BR,
Jouni Högander
>
> Suggested-by: sashiko AI review <sashiko-bot@kernel.org>
> Fixes: 2063174c22da ("drm/i915/lobf: Check for sink error and disable
> LOBF")
> Signed-off-by: Stephen J. Fuhry <fuhrysteve@gmail.com>
> ---
> drivers/gpu/drm/i915/display/intel_psr.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_psr.c
> b/drivers/gpu/drm/i915/display/intel_psr.c
> index 9382ad1e01d8..0701c8b94aa2 100644
> --- a/drivers/gpu/drm/i915/display/intel_psr.c
> +++ b/drivers/gpu/drm/i915/display/intel_psr.c
> @@ -3869,6 +3869,8 @@ static void psr_alpm_check(struct intel_dp
> *intel_dp)
> if (intel_alpm_get_error(intel_dp)) {
> intel_psr_disable_locked(intel_dp);
> psr->sink_not_reliable = true;
> + intel_alpm_disable(intel_dp);
> + intel_dp->alpm.sink_alpm_error = true;
> }
> }
> --
> 2.39.5
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/i915/display: fix ALPM error handling in psr_alpm_check()
2026-06-11 14:49 ` [PATCH] drm/i915/display: fix ALPM error handling in psr_alpm_check() Stephen J. Fuhry
2026-06-11 14:59 ` Hogander, Jouni
@ 2026-06-11 15:45 ` Stephen J. Fuhry
1 sibling, 0 replies; 6+ messages in thread
From: Stephen J. Fuhry @ 2026-06-11 15:45 UTC (permalink / raw)
To: intel-gfx; +Cc: Jouni Högander, Animesh Manna, Jani Nikula
Thanks for the explanation Jouni. I missed the has_psr guard in
intel_alpm_enable_lobf() -- LOBF can't be active while PSR2 is running,
so the double-read consequence is benign.
Dropping this patch.
^ permalink raw reply [flat|nested] 6+ messages in thread
* ✗ LGCI.VerificationFailed: failure for drm/i915/display: guard intel_alpm_get_error() against non-ALPM sinks (rev2)
2026-06-11 12:54 [PATCH] drm/i915/display: guard intel_alpm_get_error() against non-ALPM sinks Stephen J. Fuhry
2026-06-11 13:17 ` Hogander, Jouni
2026-06-11 14:49 ` [PATCH] drm/i915/display: fix ALPM error handling in psr_alpm_check() Stephen J. Fuhry
@ 2026-06-12 13:22 ` Patchwork
2 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2026-06-12 13:22 UTC (permalink / raw)
To: Stephen Fuhry; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/display: guard intel_alpm_get_error() against non-ALPM sinks (rev2)
URL : https://patchwork.freedesktop.org/series/168435/
State : failure
== Summary ==
Series author address 'fuhrysteve@gmail.com' is not on the allowlist, which prevents CI from being automatically triggered.
If you want CI to run for this series, ask Patchwork project owners to click 'retest' on the series in Patchwork.
Exception occurred during validation, bailing out!
Build URL: http://gfx-ci.igk.intel.com:8080/job/CI_PW_kernel/179293/ (on built-in)
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-06-12 13:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-11 12:54 [PATCH] drm/i915/display: guard intel_alpm_get_error() against non-ALPM sinks Stephen J. Fuhry
2026-06-11 13:17 ` Hogander, Jouni
2026-06-11 14:49 ` [PATCH] drm/i915/display: fix ALPM error handling in psr_alpm_check() Stephen J. Fuhry
2026-06-11 14:59 ` Hogander, Jouni
2026-06-11 15:45 ` Stephen J. Fuhry
2026-06-12 13:22 ` ✗ LGCI.VerificationFailed: failure for drm/i915/display: guard intel_alpm_get_error() against non-ALPM sinks (rev2) Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox