From 25d4e4fbddd4d6a83bd50b212acd5db5a6f64e5b Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Fri, 6 Mar 2020 10:13:50 -0800 Subject: [PATCH] Revert "phc2sys: Notify kernel if clock is not in sync" This novel use of the STA_UNSYNC flag breaks with the established, traditional meaning of that flag, which is: The clock has is believed to have an error larger than 16 seconds. This reverts commit 944f5f7ac6eb1b638d5bc6c61b09cd39d8dbd669. Signed-off-by: Richard Cochran --- clockadj.c | 11 ----------- clockadj.h | 5 ----- phc2sys.c | 4 +--- 3 files changed, 1 insertion(+), 19 deletions(-) diff --git a/clockadj.c b/clockadj.c index 7b8feef..0485d8c 100644 --- a/clockadj.c +++ b/clockadj.c @@ -182,14 +182,3 @@ void sysclk_set_sync(void) if (clock_adjtime(clkid, &tx) < 0) pr_err("failed to set clock status and maximum error: %m"); } - -void sysclk_set_unsync(void) -{ - clockid_t clkid = CLOCK_REALTIME; - struct timex tx; - memset(&tx, 0, sizeof(tx)); - tx.modes = ADJ_STATUS; - tx.status = STA_UNSYNC; - if (clock_adjtime(clkid, &tx) < 0) - pr_err("failed to set clock status: %m"); -} diff --git a/clockadj.h b/clockadj.h index 8a98627..4ea98c1 100644 --- a/clockadj.h +++ b/clockadj.h @@ -80,9 +80,4 @@ int sysclk_max_freq(void); * the real-time clock (RTC) to it. */ void sysclk_set_sync(void); - -/** - * Mark the system clock as unsynchronized. - */ -void sysclk_set_unsync(void); #endif diff --git a/phc2sys.c b/phc2sys.c index 80d0b8e..c0b7b3d 100644 --- a/phc2sys.c +++ b/phc2sys.c @@ -735,10 +735,8 @@ static int do_loop(struct node *node, int subscriptions) reconfigure(node); } } - if (!node->master) { - sysclk_set_unsync(); + if (!node->master) continue; - } LIST_FOREACH(clock, &node->dst_clocks, dst_list) { if (!update_needed(clock))