drivers: can: common: include sync segment in timing calculation

Always include the SYNC segment of 1 time quanta when calculating ts1 and
ts2.

Fixes: #55919

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
Henrik Brix Andersen 2023-03-17 12:14:58 +01:00 committed by Carles Cufí
commit 7073da0257

View file

@ -99,7 +99,7 @@ static int update_sampling_pnt(uint32_t ts, uint32_t sp, struct can_timing *res,
}
} else if (ts1 < ts1_min) {
ts1 = ts1_min;
ts2 = ts - ts1;
ts2 = ts - CAN_SYNC_SEG - ts1;
if (ts2 < min->phase_seg2) {
return -1;
}