Commit 6cdecd8b authored by Alessandro Rubini's avatar Alessandro Rubini

wr-servo: bugfix for unlikely whole-second offset

If we were offset by a whole second, we'd remain in SYNC_SEC (SYNC_TAI)
without moving to SYNC_PHASE. It happens when you change the second counter
by hand, but it's very unlikely in the initial setup.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent d0192a54
......@@ -341,6 +341,12 @@ int wr_servo_update(struct pp_instance *ppi)
wrp->ops->adjust_counters(ts_offset_hw.seconds, 0);
wrp->ops->adjust_phase(0);
s->flags |= WR_FLAG_WAIT_HW;
/*
* If nsec wrong, code above forces SYNC_NSEC,
* Else, we must ensure we leave this status towards
* fine tuning
*/
s->state = WR_SYNC_PHASE;
break;
case WR_SYNC_NSEC:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment