> -----Original Message----- > From: Intel-xe <[email protected]> On Behalf Of Imre Deak > Sent: Monday, 1 June 2026 12.38 > To: [email protected]; [email protected] > Subject: [PATCH v2 09/22] 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 <[email protected]> > Signed-off-by: Imre Deak <[email protected]> > --- > drivers/gpu/drm/i915/display/intel_dp_link_training.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > 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 e766f7c323f72..f03e05c730a25 100644 > --- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c > +++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c > @@ -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 > -- > 2.49.1
