sync lost on slave every ~49.7 days
Every ~49.7 days the update counter in micro-seconds overflows. The macro time_after_eq
from file include/ppsi/jiffies.h
after the change done in the past does not handle the comparison of a timestamp before and after overflow correctly. Due to this bug some timeouts are triggered in the wrong time. Which in the end causes the lost of synchronization.
The sync is lost at around (2^32 - 48000) miliseconds. The timer for PROT_STATE
is set up to 48 seconds in the future (the most in the future from all timers). When the timestamp of next timout overflows then the time_after_eq
wrongly compare which timestamp is ahead. At this point master goes from EXT_ON
to EXT_OFF
and slave's servo jumps out of TRACK_PHASE
. The synchronization is lost. The bug #32 may manifest itself causing the slave's servo not to update.
The issue is also described in wr-switch-sw#240 (closed).
Related to #32.