linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: RTC subsystem and fractions of seconds
@ 2007-01-06  3:49 David Brownell
  2007-01-06 23:26 ` Philippe De Muyter
  2007-01-07 10:14 ` Philippe De Muyter
  0 siblings, 2 replies; 12+ messages in thread
From: David Brownell @ 2007-01-06  3:49 UTC (permalink / raw)
  To: Philippe De Muyter; +Cc: Linux Kernel list

>  	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?

Either way, that raises the question of what other features should
be included.  What sub-second precision?  Multiple alarms?  Ways
to manage output clocks?  Sub-HZ periodic alarms?


^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: RTC subsystem and fractions of seconds
@ 2007-01-07 22:31 Philippe De Muyter
  0 siblings, 0 replies; 12+ messages in thread
From: Philippe De Muyter @ 2007-01-07 22:31 UTC (permalink / raw)
  To: hugh, david-b; +Cc: linux-kernel


On Sun, 7 Jan 2007, Hugh Dickins wrote:
> Author: Matt Mackall <mpm@selenic.com>
> 
>     [PATCH] RTC: Remove RTC UIP synchronization on x86
>     
>     Reading the CMOS clock on x86 and some other arches currently takes up to one
>     second because it synchronizes with the CMOS second tick-over.  This delay
>     shows up at boot time as well a resume time.

That is true if kernel's idea of an RTC's precision is 1 second.  With better
RTC's (e.g. m41t81) this delay can be reduced to 0.01 second, which is
acceptable IMHO in the boot phase.  That needs however changes in the kernel
interface to RTC's :

    - read_time should take a new parameter *nsec (or struct rtc_time should
    contain a new nsec field, so that the RTC can report its complete time
    information to the kernel.

    - struct rtc_device (or rtc_class_ops with another name) should contain
    a new field giving the RTC's resolution in nsecs, if we want to avoid the
    loop, but do not want our 0.01 second precision be destructed by always
    adding 0.5 second in rtc_hctosys
    
Philippe

^ permalink raw reply	[flat|nested] 12+ messages in thread
* RTC subsystem and fractions of seconds
@ 2007-01-06  2:29 Philippe De Muyter
  0 siblings, 0 replies; 12+ messages in thread
From: Philippe De Muyter @ 2007-01-06  2:29 UTC (permalink / raw)
  To: linux-kernel

Hi all,

A comment in driver/rtc/hctosys says :

    /* IMPORTANT: the RTC only stores whole seconds. It is arbitrary
     * whether it stores the most close value or the value with partial
     * seconds truncated. However, it is important that we use it to store
     * the truncated value. This is because otherwise it is necessary,
     * in an rtc sync function, to read both xtime.tv_sec and
     * xtime.tv_nsec. On some processors (i.e. ARM), an atomic read
     * of >32bits is not possible. So storing the most close value would
     * slow down the sync API. So here we have the truncated value and
     * the best guess is to add 0.5s.
     */

I work with ST m41t81 rtc's.  Those rtc's actually have a 1/100th of second
register.  Should the generic rtc interface not support that ? 

Philippe
-- 

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

end of thread, other threads:[~2007-01-08 10:25 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-06  3:49 RTC subsystem and fractions of seconds David Brownell
2007-01-06 23:26 ` Philippe De Muyter
2007-01-06 23:52   ` David Brownell
2007-01-07  1:11     ` Hugh Dickins
2007-01-07  2:54       ` David Brownell
2007-01-07  9:43         ` Hugh Dickins
2007-01-07 10:02     ` Philippe De Muyter
2007-01-07 10:14 ` Philippe De Muyter
2007-01-08  2:10   ` David Brownell
2007-01-08 10:25     ` Philippe De Muyter
  -- strict thread matches above, loose matches on Subject: below --
2007-01-07 22:31 Philippe De Muyter
2007-01-06  2:29 Philippe De Muyter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).