From e1833e020a078a2cb6e24a4dfbddac3fb6303256 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Mon, 9 Jul 2018 12:18:30 -0400 Subject: [PATCH] chelper: Use CLOCK_MONOTONIC_RAW Switch the host code from the CLOCK_MONOTONIC clock to the Linux specific CLOCK_MONOTONIC_RAW clock. It's common for ntp to slew the CLOCK_MONOTONIC clock to account for drift, and that can break the host's ability to make accurate predictions of the micro-controller clock. This could lead to "move queue empty" errors. The CLOCK_MONOTONIC_RAW clock is not slewed and thus should not have this problem. Signed-off-by: Kevin O'Connor --- klippy/chelper/pyhelper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/klippy/chelper/pyhelper.c b/klippy/chelper/pyhelper.c index 947e5ee1..a0a42923 100644 --- a/klippy/chelper/pyhelper.c +++ b/klippy/chelper/pyhelper.c @@ -18,7 +18,7 @@ double __visible get_monotonic(void) { struct timespec ts; - int ret = clock_gettime(CLOCK_MONOTONIC, &ts); + int ret = clock_gettime(CLOCK_MONOTONIC_RAW, &ts); if (ret) { report_errno("clock_gettime", ret); return 0.;