Skip to content

Commit a2e2e35

Browse files
David Brownelltorvalds
authored andcommitted
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>
1 parent 44ccac1 commit a2e2e35

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎kernel/power/main.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,13 @@ static void __init test_wakealarm(struct rtc_device *rtc, suspend_state_t state)
635635
}
636636
if (status < 0)
637637
printk(err_suspend, status);
638+
639+
/* Some platforms can't detect that the alarm triggered the
640+
* wakeup, or (accordingly) disable it after it afterwards.
641+
* It's supposed to give oneshot behavior; cope.
642+
*/
643+
alm.enabled = false;
644+
rtc_set_alarm(rtc, &alm);
638645
}
639646

640647
static int __init has_wakealarm(struct device *dev, void *name_ptr)

0 commit comments

Comments
 (0)