projects/linux·commit a2e2e357

pm selftest: rtc paranoia

a2e2e357 · David Brownell <[email protected]> · 2008-07-25 19:44:38 -07:00

Cope with a quirk of some RTCs (notably ACPI ones) which aren't guaranteed
to implement oneshot behavior when they woke the system from sleeep:
forcibly disable the alarm, just in case.

Signed-off-by: David Brownell <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
a2e2e3577c3ef2b5dbb866e97e612aae4adfa32f
Parents
44ccac13

Changes

1 files changed · +7 −0

FileStatusAddDelContent
kernel/power/main.cmodified+7−0View file

kernel/power/main.c

View file
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 95bff23..0b7476f 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -635,6 +635,13 @@ static void __init test_wakealarm(struct rtc_device *rtc, suspend_state_t state)
}
if (status < 0)
printk(err_suspend, status);
+
+ /* Some platforms can't detect that the alarm triggered the
+ * wakeup, or (accordingly) disable it after it afterwards.
+ * It's supposed to give oneshot behavior; cope.
+ */
+ alm.enabled = false;
+ rtc_set_alarm(rtc, &alm);
}
static int __init has_wakealarm(struct device *dev, void *name_ptr)