Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtc: disable hpet emulation on suspend

I noticed that rtc wont generate interrupts after a resume from disk.
Here hpet rtc emulation is used.

Problem is that rtc hpet comparator, isn't reinitialized after resume.
Easiest way to solve this, is always mask all hpet interrupts on suspend
This is triggered, when suspending with alarm set.

Otherwise, hpet driver will think it doesn't need to reinitialize
the rtc comparator, thus rtc interrupts won't work.

This emulation isn't need for wakealarm.

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Cc: David Brownell <david-b@pacbell.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Maxim Levitsky and committed by
Linus Torvalds
d1b2efa8 213614d5

+2 -1
+2 -1
drivers/rtc/rtc-cmos.c
··· 871 871 mask = RTC_IRQMASK; 872 872 tmp &= ~mask; 873 873 CMOS_WRITE(tmp, RTC_CONTROL); 874 - hpet_mask_rtc_irq_bit(mask); 875 874 875 + /* shut down hpet emulation - we don't need it for alarm */ 876 + hpet_mask_rtc_irq_bit(RTC_PIE|RTC_AIE|RTC_UIE); 876 877 cmos_checkintr(cmos, tmp); 877 878 } 878 879 spin_unlock_irq(&rtc_lock);