lkml.org 
[lkml]   [2007]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: RTC subsystem and fractions of seconds
On Sat, Jan 06, 2007 at 03:52:43PM -0800, David Brownell wrote:
> On Saturday 06 January 2007 3:26 pm, Philippe De Muyter wrote:
> > On Fri, Jan 05, 2007 at 07:49:00PM -0800, David Brownell wrote:
> > > > Those rtc's actually have a 1/100th of second
> > > > register. Should the generic rtc interface not support that?
> > >
> > > Are you implying a new userspace API, or just an in-kernel update?
> >
> > My only concern at the moment is initializing linux's timeofday from the rtc
> > quickly and with a good precision.
>
> There will necessarily be a bit of fuzz there since it can take time to
> get that RTC's mutex, and the task setting that time can be preempted.
> Plus, there can also be delays at the I2C or SPI transaction level.
>
>
> > The way it is done currently
> > in drivers/rtc/hctosys.c is 0.5 sec off. We could obtain a much better
> > precision by looping there until the next change (next second for old clocks,
> > next 0.01 second for m41t81, maybe even better for other ones).
>
> Hmm ... "looping" fights against "quickly"; as would "wait for next
> update IRQ" (on RTCs that support that). But it would improve precision,
> at least in the sense of having the system clock and that RTC spending
> less time with the lowest "seconds" digit disagreeing.
>
> This is something you could write a patch for, n'est-ce pas?

That would require changing the interface provided by the rtc class, but
I'll look at it.

>
> - Dave
>
>

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-01-07 11:05    [W:0.259 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site