[ntp:questions] Linux 11-minute mode (RTC update)
root at localhost.invalid
Thu Apr 3 14:25:17 UTC 2008
I run Linux kernel 220.127.116.11-rt9 and ntpd 4.2.4p0
# adjtimex --print
raw time: 1207230744s 183249us = 1207230744.183249
In my setup, STA_UNSYNC (0x0040, clock unsynchronized) is 0.
Thus, ntp_synced() returns 1.
Thus the kernel should write the system time to the RTC every
11 minutes; but it does not.
The relevant code is in sync_cmos_clock()
I've added several printk() to this function, and it appears
that it is never called.
The relevant timer is defined with the following macro.
static DEFINE_TIMER(sync_cmos_timer, sync_cmos_clock, 0, 0);
which expands to
static struct timer_list sync_cmos_timer =
.function = sync_cmos_clock,
.expires = 0,
.data = 0,
.base = &boot_tvec_bases
The problem seems to be that this timer is never armed, to bootstrap
the process. It seems there should be a call to mod_timer() somewhere.
do_adjtimex() calls notify_cmos_timer() unconditionally.
static void notify_cmos_timer(void)
mod_timer(&sync_cmos_timer, jiffies + 1);
What are the semantics of notify_cmos_timer?
What is it supposed to do?
And what is 'no_sync_cmos_clock' supposed to mean?
/* Disable the cmos update - used by virtualization and embedded */
int no_sync_cmos_clock __read_mostly;
Why would we (re)arm the timer when 'no_sync_cmos_clock' is true?
I'd be grateful for anyone sharing their knowledge.
More information about the questions