Re: [PATCH v7 3/7] timekeeping: Account for clocksource tick quantisation via NTP

From: David Woodhouse

Date: Thu Jul 09 2026 - 12:27:17 EST


On Thu, 2026-07-09 at 18:21 +0200, Marek Szyprowski wrote:
>
> Yes! Feel free to add:
>
> Reported-by: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>
>
> Tested-by: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>

Thank you. I guess I could throw a

Signed-off-by: David Woodhouse <dwmw@xxxxxxxxxxxx>

in too, just in case (as I'm going to be away for the next week or so,
starting about now as I hear footsteps approaching the study).

Thomas, do you want an incremental patch or is it OK to fold the one-
liner back into the offending original?

> --- a/kernel/time/timekeeping.c
> +++ b/kernel/time/timekeeping.c
> @@ -352,7 +352,7 @@ static void tk_setup_internals(struct timekeeper *tk, struct clocksource *clock)
> tk->tkr_raw.cycle_last = tk->tkr_mono.cycle_last;
>
> /* Do the ns -> cycle conversion first, using original mult */
> - interval = NTP_INTERVAL_LENGTH << clock->shift;
> + interval = (u64)NTP_INTERVAL_LENGTH << clock->shift;
> interval += clock->mult/2;
> do_div(interval, clock->mult);
> if (interval == 0)