Kernel Bug Tracker – Bug 29692
Wake on RTC no longer works in some kernel configurations
Last modified: 2011-03-03 01:02:43 UTC
Waking from S5 via RTC by writing to /sys/class/rtc/rtc0/wakealarm had been working for me for quite some time, until moving to a 2.6.37 kernel. After some digging, I found that /sys/class/rtc/rtc0/device/power/wakeup was set to disabled, while it was always set to enabled on previous kernels, and this appeared to be the main visible difference.
I eventually tracked it down to to the differences in include/linux/pm_wakeup.h between 2.6.36 and 2.6.37. The rtc-cmos driver calls device_init_wakeup() during initialization, which sets the can_wakeup flag to 1. But device_init_wakeup() doesn't do anything today unless CONFIG_PM_SLEEP is set. And CONFIG_PM_SLEEP doesn't get enabled unless CONFIG_SUSPEND || CONFIG_HIBERNATION || CONFIG_XEN_SAVE_RESTORE are enabled.
Seems like you shouldn't have to enable suspend to disk or suspend to RAM support in order to wake from S5, but I don't know what the proper solution is. I tried the following quick and dirty hack, and things did work after recompiling my kernel with that change; but it's obviously not a proper fix.
--- linux-18.104.22.168/kernel/power/Kconfig 2011-02-17 23:44:35.000000000 +0000
+++ linux-22.214.171.124.jm/kernel/power/Kconfig 2011-02-23 03:44:02.000000000 +0000
@@ -92,7 +92,7 @@
- depends on SUSPEND || HIBERNATION || XEN_SAVE_RESTORE
+ depends on SUSPEND || HIBERNATION || XEN_SAVE_RESTORE || RTC_CLASS=y
Created attachment 48712 [details]
PM: Fix ACPI wakeup from S5 when CONFIG_PM_SLEEP is unset
Thanks for the report. Does the attached patch help (on top of 2.6.38-rc6)?
Yes, it works perfectly again with your patch. Thanks for the quick response!
Author: Rafael J. Wysocki <firstname.lastname@example.org>
Date: Thu Feb 24 11:10:01 2011 +0100
PM: Make ACPI wakeup from S5 work again when CONFIG_PM_SLEEP is unset
shipped in linux-2.6.38-rc7