Skip to content

clocksource/drivers/timer-npcm7xx: Fix timer1 warning, add sched_clock

William A. Kennington III lkml openbmc 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2clocksource/drivers/timer-npcm7xx: Fix spurious timer1 clock warningdrivers/clocksource/timer-npcm7xx.c+9 -50 replies
2/2clocksource/drivers/timer-npcm7xx: Register timer1 as sched_clockdrivers/clocksource/timer-npcm7xx.c+9 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] clocksource/drivers/timer-npcm7xx: Fix timer1 warning, add sched_clock

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(-)