Signed-off-by: Andrew Morton --- 25-akpm/arch/i386/kernel/time.c | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-) diff -puN arch/i386/kernel/time.c~x86-cmos-time-update-optimisation-tidy arch/i386/kernel/time.c --- 25/arch/i386/kernel/time.c~x86-cmos-time-update-optimisation-tidy Thu Mar 10 16:12:50 2005 +++ 25-akpm/arch/i386/kernel/time.c Thu Mar 10 16:12:50 2005 @@ -331,6 +331,7 @@ static void sync_cmos_clock(unsigned lon { struct timeval now, next; int fail = 1; + /* * If we have an externally synchronized Linux clock, then update * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be @@ -347,29 +348,30 @@ static void sync_cmos_clock(unsigned lon do_gettimeofday(&now); if (now.tv_usec >= USEC_AFTER - ((unsigned) TICK_SIZE) / 2 && - now.tv_usec <= USEC_BEFORE + ((unsigned) TICK_SIZE) / 2) { + now.tv_usec <= USEC_BEFORE + ((unsigned) TICK_SIZE) / 2) fail = set_rtc_mmss(now.tv_sec); - } + next.tv_usec = USEC_AFTER - now.tv_usec; if (next.tv_usec <= 0) next.tv_usec += USEC_PER_SEC; - if (!fail) { + + if (!fail) next.tv_sec = 659; - } else { + else next.tv_sec = 0; - } + if (next.tv_usec >= USEC_PER_SEC) { next.tv_sec++; next.tv_usec -= USEC_PER_SEC; } - sync_cmos_timer.expires = jiffies + timeval_to_jiffies(&next); - add_timer(&sync_cmos_timer); - + mod_timer(&sync_cmos_timer, jiffies + timeval_to_jiffies(&next)); } + void notify_arch_cmos_timer(void) { sync_cmos_clock(0); } + static long clock_cmos_diff, sleep_start; static int timer_suspend(struct sys_device *dev, u32 state) _