Question about update_persistent_clock() routine

From: Jimmie Mayfield <hidden>
Date: 2022-02-28 06:22:39

Hi,

I'm investigating a timekeeping problem on an old PPC-based embedded device and am curious about the update_persistent_clock() routine.   This device runs a 3.10-era kernel but a similar (deprecated) function exists in the 5.16 kernels so I'll refer to the latter:

In arch/powerpc/kernel/time.c :: update_persistent_clock64() we have the following:

    rtc_time64_to_tm(now.tv_sec + 1 + timezone_offset, &tm);

I'm particularly curious about why a second is added to the value when building 'tm'.  This behavior appears to go back at least to the 2.6-era kernels.  Is it simply trying to account for the time spent in the kernel prior to updating the RTC?


Jimmie
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help