Skip to content

Commit fa9637f

Browse files
ideakopsiff
authored andcommitted
drm/i915/dp: Fix error handling during 128b/132b link training
commit b9275ea upstream. At the end of a 128b/132b link training sequence, the HW expects the transcoder training pattern to be set to TPS2 and from that to normal mode (disabling the training pattern). Transitioning from TPS1 directly to normal mode leaves the transcoder in a stuck state, resulting in page-flip timeouts later in the modeset sequence. Atm, in case of a failure during link training, the transcoder may be still set to output the TPS1 pattern. Later the transcoder is then set from TPS1 directly to normal mode in intel_dp_stop_link_train(), leading to modeset failures later as described above. Fix this by setting the training patter to TPS2, if the link training failed at any point. The clue in the specification about the above HW behavior is the explicit mention that TPS2 must be set after the link training sequence (and there isn't a similar requirement specified for the 8b/10b link training), see the Bspec links below. v2: Add bspec aspect/link to the commit log. (Jani) Bspec: 54128, 65448, 68849 Cc: stable@vger.kernel.org # v5.18+ Cc: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Acked-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250217223828.1166093-2-imre.deak@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> (cherry picked from commit 8b4bbaf) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit f16a74c)
1 parent d5fdbb7 commit fa9637f

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

drivers/gpu/drm/i915/display/intel_dp_link_training.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,7 @@ intel_dp_128b132b_link_train(struct intel_dp *intel_dp,
13641364

13651365
if (wait_for(intel_dp_128b132b_intra_hop(intel_dp, crtc_state) == 0, 500)) {
13661366
lt_err(intel_dp, DP_PHY_DPRX, "128b/132b intra-hop not clear\n");
1367-
return false;
1367+
goto out;
13681368
}
13691369

13701370
if (intel_dp_128b132b_lane_eq(intel_dp, crtc_state) &&
@@ -1376,6 +1376,19 @@ intel_dp_128b132b_link_train(struct intel_dp *intel_dp,
13761376
passed ? "passed" : "failed",
13771377
crtc_state->port_clock, crtc_state->lane_count);
13781378

1379+
out:
1380+
/*
1381+
* Ensure that the training pattern does get set to TPS2 even in case
1382+
* of a failure, as is the case at the end of a passing link training
1383+
* and what is expected by the transcoder. Leaving TPS1 set (and
1384+
* disabling the link train mode in DP_TP_CTL later from TPS1 directly)
1385+
* would result in a stuck transcoder HW state and flip-done timeouts
1386+
* later in the modeset sequence.
1387+
*/
1388+
if (!passed)
1389+
intel_dp_program_link_training_pattern(intel_dp, crtc_state,
1390+
DP_PHY_DPRX, DP_TRAINING_PATTERN_2);
1391+
13791392
return passed;
13801393
}
13811394

0 commit comments

Comments
 (0)