Commit 67dfae0c authored by John Stultz's avatar John Stultz Committed by Thomas Gleixner

clocksource: Fix abs() usage w/ 64bit values

This patch fixes one cases where abs() was being used with 64-bit
nanosecond values, where the result may be capped at 32-bits.

This potentially could cause watchdog false negatives on 32-bit
systems, so this patch addresses the issue by using abs64().
Signed-off-by: default avatarJohn Stultz <>
Cc: Prarit Bhargava <>
Cc: Richard Cochran <>
Cc: Ingo Molnar <>
Link: default avatarThomas Gleixner <>
parent bdf7344e
......@@ -217,7 +217,7 @@ static void clocksource_watchdog(unsigned long data)
/* Check the deviation from the watchdog clocksource. */
if ((abs(cs_nsec - wd_nsec) > WATCHDOG_THRESHOLD)) {
if (abs64(cs_nsec - wd_nsec) > WATCHDOG_THRESHOLD) {
pr_warn("timekeeping watchdog: Marking clocksource '%s' as unstable because the skew is too large:\n",
pr_warn(" '%s' wd_now: %llx wd_last: %llx mask: %llx\n",
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment