summaryrefslogtreecommitdiff
path: root/kernel/power
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2008-07-25 19:44:38 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-26 12:00:02 -0700
commita2e2e3577c3ef2b5dbb866e97e612aae4adfa32f (patch)
tree9f0889d3046078e1db7e8310171c7e3a48be42cc /kernel/power
parent44ccac13c7f4728cf2992d49384671a176db74dd (diff)
pm selftest: rtc paranoia
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 <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 95bff23ecdaa..0b7476f5d2a6 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)