New: /proc/acpi/alarm worked; update to 2.6.22.2 and /sys/class/rtc/rtc0/wakealarm don't
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]/
Quoted 38 lines · On Sat, 8 Sep 2007 09:29:18 -0700 (PDT) [email protected] wrote:
http://bugzilla.kernel.org/show_bug.cgi?id=8995
Summary: /proc/acpi/alarm worked; update to 2.6.22.2 and /sys/class/rtc/rtc0/wakealarm don't Product: ACPI Version: 2.5 KernelVersion: 2.6.22.2 Platform: All OS/Version: Linux Tree: Mainline Status: NEW Severity: normal Priority: P1 Component: Power-Sleep-Wake AssignedTo: [email protected] ReportedBy: [email protected]Most recent kernel where this bug did not occur:2.6.20
Distribution: FC6
Hardware Environment: ASUS A8N-SLI mobo, Athlon 64 3200+, PATA Disk Software Environment: FC6, MythTV 0.20.2-164
Problem Description:
Change in kernel code from support for/proc/acpi/alarmto/sys/class/rtc/rtc0/wakealarmand supporting code borked working system. Will no longer wake at set time.
Time set <> time reported by cat /sys.../wakealarm. Return value off by large constant. Note: Mobo doesn't support month, day, or year in alarm setting.Steps to reproduce:
Before upgrade from 2.6.20 to 2.6.22.2, suspend-to-disk with powerdown to standby would wake at time echoed into/proc/acpi/alarm. Change of wakeup time setting code to echo 0 to/sys/class/rtc/rtc0/wakealarmfollowed by echo of seconds since epoch of desired wakeup time under 2.6.22.2 does not work. System will not wake up at specified time. Will wake by keyboard keystroke, such as Ctrl+Esc. Tried enabling APM (BIOS) alarm setting and all entries under/proc/acpi/wakeup(all on at once), but no improvement.
Test sequence:
Quoted 14 lines
# echo 0 > /sys/class/rtc/rtc0/wakealarm # t=`date +%s`; w=`expr $t + 60`; echo $w > /sys/class/rtc/rtc0/wakealarm # echo $w 1189268800 # cat /sys/class/rtc/rtc0/wakealarm 2076101696 # expr 2076101696 - 1189268800 886832896 <invoke your favorite code to suspend to disk and power down system leaving standby power on> <wait> <wait some more> <hit power on button>
Guys, can we please work out where the problem lies here? Is it in the new RTC code, ACPI or what?
Thanks.
Quoted 55 lines · Andrew Morton
Quoted 38 lines · On Sat, 8 Sep 2007 09:29:18 -0700 (PDT) [email protected] wrote:
http://bugzilla.kernel.org/show_bug.cgi?id=8995
Summary: /proc/acpi/alarm worked; update to 2.6.22.2 and /sys/class/rtc/rtc0/wakealarm don't Product: ACPI Version: 2.5 KernelVersion: 2.6.22.2 Platform: All OS/Version: Linux Tree: Mainline Status: NEW Severity: normal Priority: P1 Component: Power-Sleep-Wake AssignedTo: [email protected] ReportedBy: [email protected]Most recent kernel where this bug did not occur:2.6.20
Distribution: FC6
Hardware Environment: ASUS A8N-SLI mobo, Athlon 64 3200+, PATA Disk Software Environment: FC6, MythTV 0.20.2-164
Problem Description:
Change in kernel code from support for/proc/acpi/alarmto/sys/class/rtc/rtc0/wakealarmand supporting code borked working system. Will no longer wake at set time.
Time set <> time reported by cat /sys.../wakealarm. Return value off by large constant. Note: Mobo doesn't support month, day, or year in alarm setting.Steps to reproduce:
Before upgrade from 2.6.20 to 2.6.22.2, suspend-to-disk with powerdown to standby would wake at time echoed into/proc/acpi/alarm. Change of wakeup time setting code to echo 0 to/sys/class/rtc/rtc0/wakealarmfollowed by echo of seconds since epoch of desired wakeup time under 2.6.22.2 does not work. System will not wake up at specified time. Will wake by keyboard keystroke, such as Ctrl+Esc. Tried enabling APM (BIOS) alarm setting and all entries under/proc/acpi/wakeup(all on at once), but no improvement.
Test sequence:Quoted 14 lines
# echo 0 > /sys/class/rtc/rtc0/wakealarm # t=`date +%s`; w=`expr $t + 60`; echo $w > /sys/class/rtc/rtc0/wakealarm # echo $w 1189268800 # cat /sys/class/rtc/rtc0/wakealarm 2076101696 # expr 2076101696 - 1189268800 886832896 <invoke your favorite code to suspend to disk and power down system leaving standby power on> <wait> <wait some more> <hit power on button>
Quoted 2 lines
Guys, can we please work out where the problem lies here? Is it in the new RTC code, ACPI or what?
I think the suspend/hibernation code ordering changes after 2.6.20 are to blame here.
Reportedly, the problem can be fixed by applying the patch from
http://lkml.org/lkml/2007/8/27/392 , but that requires some other changes which are not present in 2.6.22.
It would be nice if that could be tested on 2.6.23-rc5 with the patchset from
http://www.sisk.pl/kernel/hibernation_and_suspend/2.6.23-rc5/patches/ applied and the patch from http://lkml.org/lkml/2007/8/27/392 on top of it.
Greetings,
Rafael
David Brownell
Acked-byRe http://bugzilla.kernel.org/show_bug.cgi?id=8995 ...
Quoted 2 lines · Rafael J. Wysocki
I think the suspend/hibernation code ordering changes after 2.6.20 are to blame here.
So what's the status of this now ... are we back to having the /sys/class/rtc/rtc0/wakealarm work with ACPI again, with /sys/power/state written as "standby", "mem", or "disk"
(At least on the systems where it used to work. I've had bad luck with ACPI wake on most systems. So while it'd be great to see it working everywhere, I'm just asking about the regression here.)
- Dave
p.s. some folk may need the appended patch.
===== CUT HERE
From: Mark Lord <[email protected]>
This patch fixes rtc-cmos to ignore the two upper bits when reading the BCD mday (day of month) register from CMOS. Some systems (eg. mine) seem to have the top bit set to "1" for some reason.
drivers/rtc/rtc-cmos.c +2 -1
@@ -120,7 +120,8 @@ t->time.tm_hour =CMOS_READ (RTC_HOURS_ALARM );if (cmos->day_alrm) { - t->time.tm_mday =CMOS_READ (cmos->day_alrm); +/* ignore upper bits on readback per ACPI spec */ + t->time.tm_mday =CMOS_READ (cmos->day_alrm) &0x3f ;if (!t->time.tm_mday) t->time.tm_mday =-1 ;
Quoted 9 lines · David Brownell
Re http://bugzilla.kernel.org/show_bug.cgi?id=8995 ...
Quoted 2 lines · Rafael J. Wysocki
I think the suspend/hibernation code ordering changes after 2.6.20 are to blame here.
So what's the status of this now ... are we back to having the
/sys/class/rtc/rtc0/wakealarmwork with ACPI again, with/sys/power/statewritten as "standby", "mem", or "disk"
Yes, it should work now.
The fix for the "disk" case is in the mainline:
9cd9a0058dd35268b24fa16795a92c800f4086d4
Author: Rafael J. Wysocki <[email protected]> Date: Thu Oct 18 03:04:56 2007 -0700
Hibernation: Enter platform hibernation state in a consistent way.
Quoted 6 lines · Rafael J. Wysocki
Quoted 3 lines · David Brownell
So what's the status of this now ... are we back to having the
/sys/class/rtc/rtc0/wakealarmwork with ACPI againYes, it should work now.
A current git kernel seemed to work for me on at least one system that had previously misbehaved ... both "standby" and "disk" suspend now let the wakealarm do its thing. (And STR has the usual unrelated framebuffer issues.) And I'm told another person has seen it work again on his hardware. I'll try it on a few other systems too, just to be sure.
Thanks for the bugfix, and update!
- Dave
Quoted 9 lines · David Brownell
Re http://bugzilla.kernel.org/show_bug.cgi?id=8995 ...
Quoted 2 lines · Rafael J. Wysocki
I think the suspend/hibernation code ordering changes after 2.6.20 are to blame here.
So what's the status of this now ... are we back to having the
/sys/class/rtc/rtc0/wakealarmwork with ACPI again, with/sys/power/statewritten as "standby", "mem", or "disk"
Yes, it should work now.
The fix for the "disk" case is in the mainline:
9cd9a0058dd35268b24fa16795a92c800f4086d4
Author: Rafael J. Wysocki <[email protected]> Date: Thu Oct 18 03:04:56 2007 -0700
Hibernation: Enter platform hibernation state in a consistent way.