[lkml]   [2000]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Matthew Dharm wrote:
> On Sun, Dec 17, 2000 at 09:54:18PM +0100, wrote:
> > Of course, messing with the cmos clock at all was a rather bad idea,
> > but that is a different discussion.
> True enough... but, the question is, how do we fix this? Make the logic
> more buff? Or change the algorithm to use something like minutes since the
> epoch?

Actually I agree 100% with Andries -- having the kernel write back its
time into the CMOS RTC every 11 minutes just because NTP is active seems
like a random heuristic that probably "seemed like a good idea at the time".
(Probably made more sense back when there were no other users of the RTC.)

It smells like policy in the kernel to me. What if a user wants to run NTP
but wants the CMOS RTC time as an independent clock to do something else
(possibly with the option of having a meaningful /etc/adjtime too) ?

Can't the people who want the current behaviour simply have a crontab
that runs (hw)clock -[u]w from util-linux at whatever interval they want?
Then set_rtc_mmss magically goes away, the kernel doesn't need to know
UTC vs. local, and the timer interrupt gets smaller - a Good Thing(tm).

I'd delete set_rtc_mmss entirely, but I just #ifdef'd it out in case
I'm overlooking something...


--- linux/arch/i386/kernel/time.c~ Mon Nov 20 04:16:25 2000
+++ linux/arch/i386/kernel/time.c Thu Dec 21 04:10:37 2000
@@ -28,6 +28,9 @@
* 1998-12-24 Copyright (C) 1998 Andrea Arcangeli
* Fixed a xtime SMP race (we need the xtime_lock rw spinlock to
* serialize accesses to xtime/lost_ticks).
+ * 2000-12-20 Paul Gortmaker
+ * Don't mess with the CMOS clock just because NTP is used. This
+ * gets rid of annoying "set_rtc_mmss: can't update ..." messages.

#include <linux/errno.h>
@@ -304,7 +307,16 @@

+ * NOTE: This is NOT an externally exported interface for setting
+ * the time stored in the RTC. It is ONLY used internally to store
+ * the kernel time back into the RTC if the kernel time is externally
+ * synchronized. (Yes, this smells like policy in the kernel...)
+ * If you enable this then your /etc/adjtime value(s) are no longer
+ * valid. Conversely, non-zero /etc/adjtime values can result in this
+ * spewing the "set_rtc_mmss: cant update from N to M" messages.
+ *
* In order to set the CMOS clock precisely, set_rtc_mmss has to be
* called 500 ms after the second nowtime has started, because when
* nowtime is written into the registers of the CMOS clock, it will
@@ -374,6 +386,7 @@

/* last time the cmos clock got updated */
static long last_rtc_update;

int timer_ack;

@@ -417,6 +430,7 @@

* If we have an externally synchronized Linux clock, then update
* CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be
@@ -431,6 +445,7 @@
last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */

if( MCA_bus ) {

Do You Yahoo!?
Get your free address at
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

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