[PATCH 014/108] drm/i915/dp_link_training: Check for pending autoretrain explicitly

Imre Deak
2026-04-28T12:53:15Z

Check explicitly for a pending autoretrain by matching
seq_train_failures == 1.

This makes the actual condition clear, since at the point where the
counter is checked it is also below MAX_SEQ_TRAIN_FAILURES.

This also prepares for replacing the counter with an enum in a follow-up
change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp_link_training.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.c b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
index f58bce3e0a1d3..0c5b7816dfff9 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
@@ -1290,7 +1290,7 @@ void intel_dp_stop_link_train(struct intel_dp *intel_dp,

if (!display->hotplug.ignore_long_hpd &&
link_training->seq_train_failures < MAX_SEQ_TRAIN_FAILURES) {
- int delay_ms = link_training->seq_train_failures ? 0 : 2000;
+ int delay_ms = link_training->seq_train_failures == 1 ? 0 : 2000;

intel_encoder_link_check_queue_work(encoder, delay_ms);
}
@@ -1991,7 +1991,7 @@ intel_dp_needs_link_retrain(struct intel_dp *intel_dp)
if (link_training->seq_train_failures >= MAX_SEQ_TRAIN_FAILURES)
return false;

- if (link_training->seq_train_failures)
+ if (link_training->seq_train_failures == 1)
return true;

/* Retrain if link not ok */
--
2.49.1