Subject: Re: [PATCH 2/3] powermac: proper time of day after resume

From: Gabriel Paubert <[email-masked]>
Date: Wed, 24 Jan 2007 11:36:21 +0100

On Wed, Jan 24, 2007 at 08:32:57PM +1100, Benjamin Herrenschmidt wrote:
> On Wed, 2007-01-24 at 09:54 +0100, Gabriel Paubert wrote:
> 
> > Isn't there a way to obtain a better resolution? 
> 
> Not that I know.
> 
> > The RTC has a resolution on 1 second AFAIR. This means that there will
> > be an error of up to 1 second after resume. If you run NTP, it will
> > ultimately be corrected (I believe) but it may take a fairly long time
> > given the loop bandwidth of NTP, which will also probably write for a
> > while crap values into its drift file (/var/lib/ntp/ntp.drift on Debian 
> > but location varies with distribution).
> 
> But then, people suspending/resuming laptops know what to (or not to)
> expect I suppose :-)
> 

I believed that the patch also worked on desktops. Of course, one
solution is to try to reset time from an NTP server on resume if you
are connected (if you are not, then an error of a fraction of a second
is less serious).

The best solution may require informing the user space ntp code of
such events. This requires very likely modifications to ntp itself
(I may be wrong, I've not looked at NTP code for 5 years or so).

	Gabriel