Commit 5c5c8039 authored by Alessandro Rubini's avatar Alessandro Rubini

wr-servo: loose track_phase when big offset

Even if we count failure events for SNMP (in the switch), we actually
never generate them.  The code has always been tracking phase for
any offset smaller than one clock tick (8ns or 16ns), but we'd better
jump in phase (and leave TRACK_PHASE servo state) and this is a failure.

With this commit, to loos track_phase in wrpc you can just force
the setpoint far enough from the calculated one: e.g.

  [..] cko:2 setp:929 [...]

  wrc# pll sps 0 500

  [...]  ss:'SYNC_PHASE' [...] cko:431 setp:1367 [...]

then it takes 15 iterations to converge, but that's because the
calculations the first time (as shown) are wrong. A real glitch
loosing track_phase would be recovered in 3 iterations.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 1d2c640d
......@@ -393,6 +393,12 @@ int wr_servo_update(struct pp_instance *ppi)
/* Can be disabled for manually tweaking and testing */
if(tracking_enabled) {
if (abs(ts_offset_hw.phase) >
2 * WR_SERVO_OFFSET_STABILITY_THRESHOLD) {
s->state = WR_SYNC_PHASE;
break;
}
// adjust phase towards offset = 0 make ck0 0
s->cur_setpoint += (ts_offset_hw.phase / 4);
......
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