From: Harry VanZyllDeJong <[email protected]>

[Why]
Replay can attempt PHY power management on an untrained link with no
frontend connected to its backend. The resulting ALPM handshake can
stall firmware and block display recovery.

[How]
Reject Replay enable requests while the link is inactive without
blocking disable requests.

Cc: Ian Chen <[email protected]>
Cc: Aric Cyr <[email protected]>
Signed-off-by: Harry VanZyllDeJong <[email protected]>
Signed-off-by: Chenyu Chen <[email protected]>
---
 .../amd/display/dc/link/protocols/link_edp_panel_control.c  | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git 
a/drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c 
b/drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c
index 0e9b2b675eac..3f8063f6f06c 100644
--- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c
+++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c
@@ -956,6 +956,12 @@ bool edp_set_replay_allow_active(struct dc_link *link, 
const bool *allow_active,
                }
        }
 
+       /* Replay drives the PHY/ALPM and hangs DMCUB if the link was never 
trained,
+        * e.g. on the GPU that does not own the panel after a mux switch.
+        */
+       if (allow_active && *allow_active && !link->link_status.link_active)
+               return false;
+
        /* Activate or deactivate Replay */
        if (allow_active && link->replay_settings.replay_allow_active != 
*allow_active) {
                // TODO: Handle mux change case if force_static is set
-- 
2.43.0

Reply via email to