From: Clemens Ladisch When the emulated RTC interrupt is no longer needed, we better disable it; otherwise, we get a spurious interrupt whenever the timer has rolled over and reaches the same comparator value. Having a superfluous interrupt every five minutes doesn't hurt much, but it's bad style anyway. ;-) Signed-off-by: Clemens Ladisch Acked-by: "Pallipadi, Venkatesh" Cc: Andi Kleen Signed-off-by: Andrew Morton --- arch/i386/kernel/time_hpet.c | 6 +++++- arch/x86_64/kernel/time.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff -puN arch/i386/kernel/time_hpet.c~hpet-rtc-disable-interrupt-when-no-longer-needed arch/i386/kernel/time_hpet.c --- devel/arch/i386/kernel/time_hpet.c~hpet-rtc-disable-interrupt-when-no-longer-needed 2005-10-11 00:34:50.000000000 -0700 +++ devel-akpm/arch/i386/kernel/time_hpet.c 2005-10-11 00:34:50.000000000 -0700 @@ -319,8 +319,12 @@ static void hpet_rtc_timer_reinit(void) { unsigned int cfg, cnt; - if (!(PIE_on | AIE_on | UIE_on)) + if (unlikely(!(PIE_on | AIE_on | UIE_on))) { + cfg = hpet_readl(HPET_T1_CFG); + cfg &= ~HPET_TN_ENABLE; + hpet_writel(cfg, HPET_T1_CFG); return; + } if (PIE_on && (PIE_freq > DEFAULT_RTC_INT_FREQ)) hpet_rtc_int_freq = PIE_freq; diff -puN arch/x86_64/kernel/time.c~hpet-rtc-disable-interrupt-when-no-longer-needed arch/x86_64/kernel/time.c --- devel/arch/x86_64/kernel/time.c~hpet-rtc-disable-interrupt-when-no-longer-needed 2005-10-11 00:34:50.000000000 -0700 +++ devel-akpm/arch/x86_64/kernel/time.c 2005-10-11 00:34:50.000000000 -0700 @@ -1511,8 +1511,12 @@ static void hpet_rtc_timer_reinit(void) { unsigned int cfg, cnt; - if (!(PIE_on | AIE_on | UIE_on)) + if (unlikely(!(PIE_on | AIE_on | UIE_on))) { + cfg = hpet_readl(HPET_T1_CFG); + cfg &= ~HPET_TN_ENABLE; + hpet_writel(cfg, HPET_T1_CFG); return; + } if (PIE_on && (PIE_freq > DEFAULT_RTC_INT_FREQ)) hpet_rtc_int_freq = PIE_freq; _