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().
Unified · Split
| @@ -217,7 +217,7 @@ static void clocksource_watchdog(unsigned long data) · 216 unmodified lines | ||
| 217 | 217 | continue; |
| 218 | 218 | |
| 219 | 219 | /* Check the deviation from the watchdog clocksource. */ |
| 220 | − if ((abs(cs_nsec - wd_nsec) > WATCHDOG_THRESHOLD)) { | |
| 220 | + if (abs64(cs_nsec - wd_nsec) > WATCHDOG_THRESHOLD) { | |
| 221 | 221 | pr_warn("timekeeping watchdog: Marking clocksource '%s' as unstable because the skew is too large:\n", |
| 222 | 222 | cs->name); |
| 223 | 223 | pr_warn(" '%s' wd_now: %llx wd_last: %llx mask: %llx\n", |