Skip to contentSkip to conversation

drm/msm/dp: don't report link training success after a reinit

PATCH Applied Oleg Keri 2 participants 4 messages Sep 25 – Oct 6

Subsystems (3)
lore
Share & tools
lore

Oleg Keri

author
#0 lore raw

PATCH 1/1 drm/msm/dp: don't report link training success after a reinit

When every training attempt fails, the retry loop in msm_dp_ctrl_on_link() ends on a successful msm_dp_ctrl_reinitialize_mainlink(), leaving rc at 0. The caller then enables the stream on an untrained link and the display stays dark.

The retry counter only reaches zero in that case, so treat it as a training failure.

Fixes 8ede2ecc3e5e ("drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets")
---
 drivers/gpu/drm/msm/dp/dp_ctrl.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/msm/dp/dp_ctrl.c +3 -0
@@ -2434,6 +2434,9 @@ int msm_dp_ctrl_on_link(struct msm_dp_ctrl *msm_dp_ctrl,
 	if (ctrl->link->sink_request & DP_TEST_LINK_PHY_TEST_PATTERN)
 		return rc;
 
+	if (!link_train_max_retries)
+		rc = -ETIMEDOUT;
+
 	if (rc == 0) {  /* link train successfully */
 		/*
 		 * do not stop train pattern here

base-commit: 4c253ac4b29b8c6cc6fdef8f92d4facde62e63b9

Signature · 1 line
2.55.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Oleg Keri

When every training attempt fails, the retry loop in msm_dp_ctrl_on_link() ends on a successful msm_dp_ctrl_reinitialize_mainlink(), leaving rc at 0. The caller then enables the stream on an untrained link and the display stays dark.

Quoted 9 lines

The retry counter only reaches zero in that case, so treat it as a training failure.

Fixes 8ede2ecc3e5e ("drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets")
---
 drivers/gpu/drm/msm/dp/dp_ctrl.c | 3 +++
 1 file changed, 3 insertions(+)
Signature · 2 lines
With best wishes
Dmitry
Reviewed-by on v1 1/1
#2 lore raw
In reply to Oleg Keri
Quoted 5 lines · Oleg Keri

When every training attempt fails, the retry loop in msm_dp_ctrl_on_link() ends on a successful msm_dp_ctrl_reinitialize_mainlink(), leaving rc at 0. The caller then enables the stream on an untrained link and the display stays dark.

Quoted 9 lines

The retry counter only reaches zero in that case, so treat it as a training failure.

Fixes 8ede2ecc3e5e ("drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets")
---
 drivers/gpu/drm/msm/dp/dp_ctrl.c | 3 +++
 1 file changed, 3 insertions(+)
Signature · 2 lines
With best wishes
Dmitry
#3 lore raw
In reply to Oleg Keri
Quoted 9 lines · Oleg Keri

When every training attempt fails, the retry loop in msm_dp_ctrl_on_link() ends on a successful msm_dp_ctrl_reinitialize_mainlink(), leaving rc at 0. The caller then enables the stream on an untrained link and the display stays dark.

The retry counter only reaches zero in that case, so treat it as a training failure.

[...]

Applied to msm-next, thanks!

[1/1] drm/msm/dp: don't report link training success after a reinit

      https://gitlab.freedesktop.org/lumag/msm/-/commit/a47987366e7f

Best regards,

Signature · 2 lines
With best wishes
Dmitry