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, even on hardware that never enabled
ALPM.

intel_alpm_disable() already returns early on !intel_dp->alpm_dpcd;
apply the same check in intel_alpm_get_error() so it skips the AUX
transaction when the sink does not support ALPM.

Seen on a ThinkPad T14 Gen 3 (Alder Lake-P) docked through a Lenovo
ThinkPad USB-C Dock Gen2 with two DP-MST monitors: the error fired once
on the dock's upstream DP port on every DPMS wake.

Fixes: 2063174c22da ("drm/i915/lobf: Check for sink error and disable LOBF")
Reviewed-by: Jouni Högander <[email protected]>
Signed-off-by: Stephen J. Fuhry <[email protected]>
---
v2:
- Rebased onto drm-tip. intel_alpm_get_error() now uses
  drm_dp_dpcd_read_byte(), so v1 no longer applied; the change itself
  is the same three lines.
- Carried Jouni's Reviewed-by from v1, since the logic is unchanged.
- Corrected the hardware in the commit message: the machine is a T14
  Gen 3 (Alder Lake-P), not a Gen 1.
- The error was observed with a ThinkPad USB-C Dock Gen2 and has not been
  retested since the move to a Thunderbolt 4 dock.

v1: 
https://lore.kernel.org/intel-gfx/[email protected]/

 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 f54b29e..059287d 100644
--- a/drivers/gpu/drm/i915/display/intel_alpm.c
+++ b/drivers/gpu/drm/i915/display/intel_alpm.c
@@ -754,6 +754,9 @@ bool intel_alpm_get_error(struct intel_dp *intel_dp)
        int ret;
        u8 val;
 
+       if (!intel_dp->alpm_dpcd)
+               return false;
+
        ret = drm_dp_dpcd_read_byte(aux, DP_RECEIVER_ALPM_STATUS, &val);
        if (ret < 0) {
                drm_err(display->drm, "Error reading ALPM status (%pe)\n", 
ERR_PTR(ret));
-- 
2.47.3

Reply via email to