From 2ec3829bd45c47f7382d2e3e5739f5c9df9cba76 Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Fri, 5 Apr 2013 14:32:24 +0200 Subject: [PATCH] Apply utc offset correction even when free running. When using software time stamping and a free running clock, the statistics appear to be off by the TAI offset. This patch fixes the issue by setting the internal UTC timescale flag in such cases. Signed-off-by: Richard Cochran --- clock.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clock.c b/clock.c index bd22de5..1ba30ee 100644 --- a/clock.c +++ b/clock.c @@ -574,6 +574,9 @@ struct clock *clock_create(int phc_index, struct interface *iface, int count, if (c->free_running) { c->clkid = CLOCK_INVALID; + if (timestamping == TS_SOFTWARE || timestamping == TS_LEGACY_HW) { + c->utc_timescale = 1; + } } else if (phc_index >= 0) { snprintf(phc, 31, "/dev/ptp%d", phc_index); c->clkid = phc_open(phc);