Re: [Bugme-new] [Bug 8995] New: /proc/acpi/alarm worked; update to 2.6.22.2 and /sys/class/rtc/rtc0/wakealarm don't

David Brownell
2007-11-04T19:25:34Z

Re http://bugzilla.kernel.org/show_bug.cgi?id=8995 ...

On Sunday 09 September 2007, Rafael J. Wysocki wrote:
> 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 <lkml@rtr.ca>

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.

Signed-off-by: Mark Lord <mlord@pobox.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>

--- a/drivers/rtc/rtc-cmos.c 2007-11-03 16:24:09.000000000 -0400
+++ b/drivers/rtc/rtc-cmos.c 2007-11-03 16:26:51.000000000 -0400
@@ -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;