Source: MontaVista Software, Inc. Type: Defect Fix Disposition: Pending Description: I was not happy with the locking on this. Two changes: 1) Turn off irq while setting the clock. 2) 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 time.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: linux-2.6.12-rc/arch/i386/kernel/time.c =================================================================== --- linux-2.6.12-rc.orig/arch/i386/kernel/time.c +++ linux-2.6.12-rc/arch/i386/kernel/time.c @@ -176,12 +176,12 @@ static int set_rtc_mmss(unsigned long no int retval; /* gets recalled with irq locally disabled */ - spin_lock(&rtc_lock); + spin_lock_irq(&rtc_lock); if (efi_enabled) retval = efi_set_rtc_mmss(nowtime); else retval = mach_set_rtc_mmss(nowtime); - spin_unlock(&rtc_lock); + spin_unlock_irq(&rtc_lock); return retval; } @@ -282,14 +282,14 @@ unsigned long get_cmos_time(void) { unsigned long retval; - spin_lock(&rtc_lock); + spin_lock_irq(&rtc_lock); if (efi_enabled) retval = efi_get_time(); else retval = mach_get_cmos_time(); - spin_unlock(&rtc_lock); + spin_unlock_irq(&rtc_lock); return retval; } @@ -338,7 +338,7 @@ static void sync_cmos_clock(unsigned lon } void notify_arch_cmos_timer(void) { - sync_cmos_clock(0); + mod_timer(&sync_cmos_timer, jiffies + 1); } static long clock_cmos_diff, sleep_start;