diff options
| author | George Anzinger <george@mvista.com> | 2005-03-28 03:28:42 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-03-28 03:28:42 -0800 |
| commit | 3dbbe74b828f525fba77aeb6deab49a5bd108b7b (patch) | |
| tree | 1931dac37b88c6d163872072f14ba7b2b6b29479 /kernel | |
| parent | 842ab645baf2e5137d06d2ead2cf35e6dda49dba (diff) | |
[PATCH] x86: CMOS time update optimisation
This patch changes the update of the cmos clock to be timer driven rather
than poll driven by the timer interrupt function. If the clock is not
being synced to an outside source the timer is removed and thus system
overhead is nill in that case. The update frequency is still ~11 minutes
and missing the update window still causes a retry in 60 seconds.
We want the calls to sync_cmos_clock() to be made in a consistent environment.
This was not true when calling it directly from the NTP call code. The
change means that sync_cmos_clock() is ALWAYS called from run_timers(), i.e.
as a timer call back function.
Also, call the timer code only through the timer interface (set a short timer
to do it from the ntp call).
Signed-off-by: George Anzinger <george@mvista.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/time.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/time.c b/kernel/time.c index d5400f6af052..2c0b90d79d4c 100644 --- a/kernel/time.c +++ b/kernel/time.c @@ -215,6 +215,14 @@ long pps_stbcnt; /* stability limit exceeded */ /* hook for a loadable hardpps kernel module */ void (*hardpps_ptr)(struct timeval *); +/* we call this to notify the arch when the clock is being + * controlled. If no such arch routine, do nothing. + */ +void __attribute__ ((weak)) notify_arch_cmos_timer(void) +{ + return; +} + /* adjtimex mainly allows reading (and writing, if superuser) of * kernel time-keeping variables. used by xntpd. */ @@ -398,6 +406,7 @@ leave: if ((time_status & (STA_UNSYNC|STA_CLOCKERR)) != 0 txc->stbcnt = pps_stbcnt; write_sequnlock_irq(&xtime_lock); do_gettimeofday(&txc->time); + notify_arch_cmos_timer(); return(result); } |
