Subject: Re: todr changes to improve clock accuracy across sleeps & reboots
To: Richard Earnshaw <>
From: Garrett D'Amore <>
List: tech-kern
Date: 09/07/2006 12:23:01
Richard Earnshaw wrote:
>> It would be nice if, optionally, one could wait up to one second,
>> spinning, for the RTC chip to turn over a fresh second before doing
>> inittodr. Similarly, one would, optionally, wait up to one second
>> before doing the resettodr -- that could be done with an interval
>> timer controlled sleep since the system clock has high precision.
>> I suggested making this optional (and possibly sysctlable) because
>> some people won't care and will resent the one second additional
>> delay.
> Why not leave the setting of the system clock as is (if you aren't on 
> line, then clock precision to within a second is just fine); and when 
> shutting down, don't write the RTC if it is within (say) 1 second of the 
> current time.  This way you've preserved essentially all the accuracy of 
> your RTC without stalling at any point.
> R.

For the record, on some clocks, _reading_ the RTC can take a while. 
I've seen the alchemy take up to nearly a second to _read_ the RTC. 

Garrett D'Amore, Principal Software Engineer
Tadpole Computer / Computing Technologies Division,
General Dynamics C4 Systems
Phone: 951 325-2134  Fax: 951 325-2191