Re: [PATCH v4 2/4] clocksource/drivers: Add support for the Renesas RZ/N1 timers

From: Herve Codina

Date: Wed Sep 09 2026 - 06:22:43 EST


Hi Thomas, Daniel,

On Tue, 21 Jul 2026 10:29:48 +0200
"Herve Codina (Schneider Electric)" <herve.codina@xxxxxxxxxxx> wrote:

> The Renesas RZ/N1 timer block controller is the controller in charge of
> timers available in the Renesas RZ/N1 SoCs family.
>
> This controller handles 8 timers:
> - 6 16-bit timers
> - 2 32-bit timers
>
> Each timer has its own interrupt, its own prescaler that can be used to
> divide the clock by 25 and all of them can work in either one-shot or
> periodic mode.
>
> Signed-off-by: Herve Codina (Schneider Electric) <herve.codina@xxxxxxxxxxx>
> ---
> drivers/clocksource/Kconfig | 11 +
> drivers/clocksource/Makefile | 1 +
> drivers/clocksource/timer-rzn1.c | 487 +++++++++++++++++++++++++++++++
> 3 files changed, 499 insertions(+)
> create mode 100644 drivers/clocksource/timer-rzn1.c
>

Sashiko as reported issues [0] and among them, I really don't know what to do.
--- 8< ---
[Severity: High]
Will using a 16-bit timer for the system clocksource break NO_HZ_IDLE?

Since the 16-bit timer is fed by a 1 MHz clock (clock_rate / 25), it will
wrap every ~65.5 milliseconds. Will this short wrap period force the core
timekeeping code to wake the system extremely frequently just to accumulate
time?

Would it be better to dedicate one of the available 32-bit timers to act
as the system clocksource and sched_clock?
--- 8< ---

Those 32-bit timers are assigned by the driver code to per-cpu clockevent
timers.

I could use one of the 32-bit timers for clocksource and sched_clock but this
also means the per-cpu clockevent timers will be 16-bit instead of 32-bit
timers.

Maintainers, what is better to do ?
a) 16-bit clocksource and sched_clock + 32-bit per-cpu clockevent timers
or
b) 32-bit clocksource and sched_clock + 16-bit per-cpu clockevent timers

[0] https://lore.kernel.org/all/20260721084351.CDA391F00A3A@xxxxxxxxxxxxxxx/

Best regards,
Hervé