Skip to content

Commit

Permalink
[PATCH] hpet-RTC: disable interrupt when no longer needed
Browse files Browse the repository at this point in the history
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 <clemens@ladisch.de>
Acked-by: "Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Clemens Ladisch authored and Linus Torvalds committed Oct 31, 2005
1 parent 0d29086 commit f00c96f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion arch/i386/kernel/time_hpet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 5 additions & 1 deletion arch/x86_64/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -1138,8 +1138,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;
Expand Down

0 comments on commit f00c96f

Please sign in to comment.