1 From foo@baz Mon Sep 24 09:26:11 CEST 2018
2 From: John Stultz <john.stultz@linaro.org>
3 Date: Tue, 29 May 2018 19:12:18 -0700
4 Subject: selftest: timers: Tweak raw_skew to SKIP when ADJ_OFFSET/other clock adjustments are in progress
6 From: John Stultz <john.stultz@linaro.org>
8 [ Upstream commit 1416270f4a1ae83ea84156ceba19a66a8f88be1f ]
10 In the past we've warned when ADJ_OFFSET was in progress, usually
11 caused by ntpd or some other time adjusting daemon running in non
12 steady sate, which can cause the skew calculations to be
15 Thus, this patch checks to see if the clock was being adjusted
16 when we fail so that we don't cause false negatives.
18 Cc: Thomas Gleixner <tglx@linutronix.de>
19 Cc: Ingo Molnar <mingo@kernel.org>
20 Cc: Miroslav Lichvar <mlichvar@redhat.com>
21 Cc: Richard Cochran <richardcochran@gmail.com>
22 Cc: Prarit Bhargava <prarit@redhat.com>
23 Cc: Stephen Boyd <sboyd@kernel.org>
24 Cc: Shuah Khan <shuah@kernel.org>
25 Cc: linux-kselftest@vger.kernel.org
26 Suggested-by: Miroslav Lichvar <mlichvar@redhat.com>
27 Signed-off-by: John Stultz <john.stultz@linaro.org>
28 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
30 v2: Widened the checks to look for other clock adjustments that
31 could happen, as suggested by Miroslav
32 v3: Fixed up commit message
33 Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
34 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
36 tools/testing/selftests/timers/raw_skew.c | 5 +++++
37 1 file changed, 5 insertions(+)
39 --- a/tools/testing/selftests/timers/raw_skew.c
40 +++ b/tools/testing/selftests/timers/raw_skew.c
41 @@ -146,6 +146,11 @@ int main(int argv, char **argc)
42 printf(" %lld.%i(act)", ppm/1000, abs((int)(ppm%1000)));
44 if (llabs(eppm - ppm) > 1000) {
45 + if (tx1.offset || tx2.offset ||
46 + tx1.freq != tx2.freq || tx1.tick != tx2.tick) {
47 + printf(" [SKIP]\n");
48 + return ksft_exit_skip("The clock was adjusted externally. Shutdown NTPd or other time sync daemons\n");
50 printf(" [FAILED]\n");
51 return ksft_exit_fail();