Commit 832bd0d5 authored by Alessandro Rubini's avatar Alessandro Rubini

wr-servo: move generation of the state name earlier

Since commit f3d427ee, we lost the concept of "next_state" (to make code
simple), but this means that we should report to wr_mon the state string
we acted on, not the next. Otherwise, we see SYNC_PHASE all the time,
when we are actually waiting for SYNC_SEC or SYNC_NSEC to complete the
adjustment.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 029fbf36
......@@ -328,6 +328,9 @@ int wr_servo_update(struct pp_instance *ppi)
servo_name[s->state],
s->flags & WR_FLAG_WAIT_HW ? " (wait for hw)" : "");
/* update string state name */
strcpy(s->servo_state_name, servo_name[s->state]);
switch (s->state) {
case WR_SYNC_TAI:
wrp->ops->adjust_counters(ts_offset_hw.seconds, 0);
......@@ -397,9 +400,6 @@ int wr_servo_update(struct pp_instance *ppi)
break;
}
/* update string state name */
strcpy(s->servo_state_name, servo_name[s->state]);
/* Increase number of servo updates with state different than
* WR_TRACK_PHASE. (Used by SNMP) */
if (s->state != WR_TRACK_PHASE)
......
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