Re: [PATCH v2] timekeeping: Always initialize use_nsecs when querying time from phc drivers
From: John Stultz
Date: Mon Jul 21 2025 - 20:34:09 EST
On Sun, Jul 20, 2025 at 6:56 AM Markus Blöchl <markus@xxxxxxxxx> wrote:
>
> Most drivers only populate the fields cycles and cs_id in their
> get_time_fn() callback for get_device_system_crosststamp() unless
> they explicitly provide nanosecond values.
> When this new use_nsecs field was added and used most drivers did not
> care.
> Clock sources other than CSID_GENERIC could then get converted in
> convert_base_to_cs() based on an uninitialized use_nsecs which usually
> results in -EINVAL during the following range check.
>
> Pass in a fully initialized system_counterval_t.
>
> Fixes: 6b2e29977518 ("timekeeping: Provide infrastructure for converting to/from a base clock")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Markus Blöchl <markus@xxxxxxxxx>
Sounds good. Sorry for sending you down the wrong path, and thanks to
tglx for lighting the way. :)
Acked-by: John Stultz <jstultz@xxxxxxxxxx>
thanks
-john