All of lore.kernel.org
 help / color / mirror / Atom feed
* Time keeping while suspended in the presence of persistent clock drift
@ 2021-12-09 17:55 Joel Daniels
  2021-12-09 18:06 ` Joel Daniels
  0 siblings, 1 reply; 18+ messages in thread
From: Joel Daniels @ 2021-12-09 17:55 UTC (permalink / raw)
  To: John Stultz, Thomas Gleixner, Stephen Boyd; +Cc: Joel Daniels, linux-kernel

Hi,
I have an x86 laptop whose CMOS (RTC) clock gains an extra 3.75 seconds 
per day that it is suspended (S3) or off. It keeps time quite accurately 
while awake using the TSC clock source. I use the machine about 1 hour 
per day with the machine in the S3 sleep state for the remaining 23 
hours. The machine is not usually connected to a network and I do not 
run an NTP daemon (though I do not believe this is relevant). When cold 
booting, I correct for the CMOS clock drift using hwclock before making 
the filesystem writable. When resuming from suspend-to-ram (S3), 
however, I must either use hwclock again (causing the system time to 
jump backwards and potentially upsetting programs like make) or use a 
large slew rate (absolute value greater than 1000 PPM) to correct the 
system clock. As far as I can tell there is currently no way to inform 
the kernel of my CMOS clock drift. Is this correct? I am considering 
writing a patch to make the kernel compensate for the drift of the 
persistent and/or RTC clock(s) when injecting sleep time. The patch 
would require user space to inform the kernel of the drift (probably via 
sysfs). Does this seem like a good approach? Regards, Joel Daniels



^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2021-12-16  0:10 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-09 17:55 Time keeping while suspended in the presence of persistent clock drift Joel Daniels
2021-12-09 18:06 ` Joel Daniels
2021-12-11 13:36   ` Thomas Gleixner
2021-12-13 13:39     ` Joel Daniels
2021-12-14 13:57       ` Thomas Gleixner
2021-12-14 17:43         ` Joel Daniels
2021-12-15 21:06           ` John Stultz
2021-12-15 21:32             ` Alexandre Belloni
2021-12-15 22:02               ` John Stultz
2021-12-15 22:33                 ` Thomas Gleixner
2021-12-15 23:10                   ` John Stultz
2021-12-15 22:42             ` Joel Daniels
2021-12-15 23:26               ` John Stultz
2021-12-15 23:36                 ` Alexandre Belloni
2021-12-16  0:09                   ` Joel Daniels
2021-12-15 23:28               ` Alexandre Belloni
2021-12-15 21:42         ` Alexandre Belloni
2021-12-15 22:05           ` Joel Daniels

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.