[coreboot] New patch to review for coreboot: 2c2e4a1 RTC: Don't clear pending interrupt in resume path
Stefan Reinauer (email@example.com)
gerrit at coreboot.org
Wed Nov 7 00:50:27 CET 2012
Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1741
Author: Duncan Laurie <dlaurie at chromium.org>
Date: Wed Sep 5 10:52:44 2012 -0700
RTC: Don't clear pending interrupt in resume path
The linux kernel relies on the RTC reporting pending interrupts if
the RTC alarm was used to wake the system. If we clear these flags
here then the rtc-cmos driver in the kernel will think that no
interrupts are pending and will not re-start the timerqueue to
handle the alarm timerqueue node.
This flag doesn't exist in SMM but the rtc code is compiled there.
Since rtc_init() is not called by SMM it is guarded with an ifdef.
I performed several thousand suspend/resume cycles without seeing
an issue where hwclock was unable to read from /dev/rtc. There
still is a potential kernel issue where the timerqueue can stall
but this makes that much less likely to happen on resume.
Signed-off-by: Duncan Laurie <dlaurie at chromium.org>
src/drivers/pc80/mc146818rtc.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/src/drivers/pc80/mc146818rtc.c b/src/drivers/pc80/mc146818rtc.c
index 52cfb63..6e5b92a 100644
@@ -8,6 +8,9 @@
/* control registers - Moto names
@@ -127,6 +130,7 @@ static void rtc_set_checksum(int range_start, int range_end, int cks_loc)
void rtc_init(int invalid)
int cmos_invalid = 0;
@@ -192,9 +196,20 @@ void rtc_init(int invalid)
+ * Avoid clearing pending interrupts in the resume path because
+ * the Linux kernel relies on this to know if it should restart
+ * the RTC timerqueue if the wake was due to the RTC alarm.
+ if (acpi_slp_type == 3)
/* Clear any pending interrupts */
More information about the coreboot