lkml.org 
[lkml]   [1996]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: Why touch the CMOS clock?
On  6 May 96 at 14:21, Johan Myréen wrote:

>
> I noticed the 1.3.98 patch contains the following warning:
>
> +Also, if the kernel time is synchronized with an external source, the
> +kernel will write the time back to the CMOS clock every 11 minutes. In
> +the process of doing this, the kernel briefly turns off RTC periodic
> +interrupts, so be aware of this if you are doing serious work. If you
> +don't synchronize the kernel time with an external source (via ntp or
> +whatever) then the kernel will keep its hands off the RTC, allowing you
> +exclusive access to the device for your applications.
>
> My question is: Why does the kernel have to update the RTC? It is my
> understanding that the kernel only reads the RTC at boot time and does its
> timekeeping using the timer interrupt. (Correct me if I'm wrong.) Why can't
> the RTC be left running on its own and the RTC time be used only as an
> approximation of the real time of day when the machine is power-cycled? You
> can't trust the RTC anyway if the machine is down for a longer period of
> time.

The RTC usually is more precise than the interrupt driven clock. In
Addidion as long as the RTC runs local time, you will have to change
it when entering/leaving DST. Despite of that I've seen several
occasions where the CMOS clock was not being updated even when the
kernel clock was synchronized.

I think the RTC should be updated, even when the hardware is somewhat
broken: Setting the time shouldn't affect periodic interrupts.

Maybe itimer just should preempt a running task so that you don't
have to use /dev/rtc.

>
> Johan Myreen
> jem@iki.fi
Ulrich


\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.040 / U:0.812 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site