drm/i915/dp_link_training: Clamp sequential link training failure counter

Clamp link_training->seq_train_failures to MAX_SEQ_TRAIN_FAILURES to
avoid - an unlikely - overflow. This is ok, because the code only makes
a distinction between the cases where the counter is below or at the
limit.

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

Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260601093836.3057345-10-imre.deak@intel.com
This commit is contained in:
Imre Deak
2026-06-01 12:38:22 +03:00
parent dff7081487
commit e93e1ded57

View File

@@ -1831,7 +1831,8 @@ void intel_dp_start_link_train(struct intel_atomic_state *state,
return;
}
link_training->seq_train_failures++;
if (link_training->seq_train_failures < MAX_SEQ_TRAIN_FAILURES)
link_training->seq_train_failures++;
/*
* Ignore the link failure in CI