[PATCH 0/2] clocksource/drivers/timer-npcm7xx: Fix timer1 warning, add sched_clock
From: William A. Kennington III
Date: Fri Nov 27 2026 - 21:52:35 EST
Two fixes for drivers/clocksource/timer-npcm7xx.c found while bringing
up Linux 7.3 on an NPCM730 BMC:
1. of_clk_get(np, 1) returns ERR_PTR(-ENOENT) when only one clock is
present in DT, which is the case for every in-tree device tree, so
boot always logs a spurious warning for the optional timer1 clock.
Ignore -ENOENT, add the missing newline, and check
clk_prepare_enable() errors.
2. Register the 24-bit free-running timer1 counter with
sched_clock_register() instead of falling back to jiffies, which
also enables CONFIG_IRQ_TIME_ACCOUNTING at runtime.
Tested on an NPCM730 BMC: the timer1 -ENOENT boot warning is gone,
sched_clock registers at 80 ns resolution with microsecond dmesg
timestamps, and /proc/stat reports live IRQ time under TCP load.
WPCM450, which shares the driver, was not tested.
William A. Kennington III (2):
clocksource/drivers/timer-npcm7xx: Fix spurious timer1 clock warning
clocksource/drivers/timer-npcm7xx: Register timer1 as sched_clock
drivers/clocksource/timer-npcm7xx.c | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)