[PATCH] clocksource: Use correct limit for wd-cs-wd read back delay in printing

From: Aaron Lu
Date: Thu Jul 31 2025 - 08:05:23 EST


With commit 4ac1dd3245b9("clocksource: Set cs_watchdog_read() checks
based on .uncertainty_margin"), the limit for wd-cs-wd read back delay
is changed from the static WATCHDOG_MAX_SKEW to dynamic ones based on
watchdog and cs' uncertainty_margin, but WATCHDOG_MAX_SKEW is still used
when dumping information.

Fix this by using the actual limit: md(2 * watchdog->uncertainty_margin)
+ cs->unvertainty_margin.

Signed-off-by: Aaron Lu <ziqianlu@xxxxxxxxxxxxx>
---
kernel/time/clocksource.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index e400fe150f9d7..ae0fcd5af41c2 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -290,7 +290,7 @@ static enum wd_read_status cs_watchdog_read(struct clocksource *cs, u64 *csnow,
}

pr_warn("timekeeping watchdog on CPU%d: wd-%s-wd excessive read-back delay of %lldns vs. limit of %ldns, wd-wd read-back delay only %lldns, attempt %d, marking %s unstable\n",
- smp_processor_id(), cs->name, wd_delay, WATCHDOG_MAX_SKEW, wd_seq_delay, nretries, cs->name);
+ smp_processor_id(), cs->name, wd_delay, md + cs->uncertainty_margin, wd_seq_delay, nretries, cs->name);
return WD_READ_UNSTABLE;

skip_test:
--
2.39.5