Re: [PATCH 9/9] rust: time: add ktime_get_real_seconds

From: FUJITA Tomonori

Date: Tue Sep 08 2026 - 07:37:32 EST


On Wed, 26 Aug 2026 17:28:43 +0100
Mike Lothian <mike@xxxxxxxxxxxxxx> wrote:

> Reading an `Instant<RealTime>` is the wrong tool for a caller that only
> wants a calendar time in seconds: it takes a full nanosecond timestamp and
> then needs a 64-bit division to get back to what the timekeeping core
> already maintains as a plain seconds field.
>
> Wrap `ktime_get_real_seconds()`, which is that field. Document the property
> that matters at the call site and that the type cannot express: the value
> follows CLOCK_REALTIME, so it is not monotonic and can move in either
> direction.
>
> Assisted-by: Claude:claude-opus-5
> Signed-off-by: Mike Lothian <mike@xxxxxxxxxxxxxx>
> ---
> rust/kernel/time.rs | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)

I could not find a user of this in the posted series, including the
drm/vino v3 one, which looks like it uses `Instant<Monotonic>`
everywhere. Where can I see the code that calls this, and what does
it do with the value? I would like to see the use case before judging
what this should return.