From 7d773a9b932c33581f07ee52489c3e060f57be63 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Fri, 21 Feb 2014 11:08:34 +0100 Subject: [PATCH] Initialize clock rate ratio. This fixes cumulativeScaledRateOffset reported in TIME_STATUS_NP before the rate ratio is updated from port. Signed-off-by: Miroslav Lichvar --- clock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clock.c b/clock.c index 8d512ca..219436f 100644 --- a/clock.c +++ b/clock.c @@ -646,6 +646,7 @@ struct clock *clock_create(int phc_index, struct interface *iface, int count, pr_err("Failed to create delay filter"); return NULL; } + c->nrr = 1.0; c->stats_interval = dds->stats_interval; c->stats.offset = stats_create(); c->stats.freq = stats_create(); @@ -1188,6 +1189,7 @@ static void handle_state_decision_event(struct clock *c) c->t1 = tmv_zero(); c->t2 = tmv_zero(); c->path_delay = 0; + c->nrr = 1.0; fresh_best = 1; }