Bug 14965 - /sys/class/rtc/rtc0/wakealarm doesn't work since 2.6.32
Summary: /sys/class/rtc/rtc0/wakealarm doesn't work since 2.6.32
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-30 23:17 UTC by Michael Meier
Modified: 2010-01-06 23:54 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.32
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments
Kernel configuration for Intel Essentials D945GCLF2 (50.72 KB, text/plain)
2009-12-30 23:19 UTC, Michael Meier
Details
Restore wakealarm function on shutdown (1.10 KB, patch)
2010-01-04 22:52 UTC, Simon Munton
Details | Diff

Description Michael Meier 2009-12-30 23:17:22 UTC
Description: RTC wakeup doesn't work anymore since kernel 2.6.32. This was tested on two different mainboards.

Command used to test:
echo $((`cat /sys/class/rtc/rtc0/since_epoch`+60)) > /sys/class/rtc/rtc0/wakealarm


Hardware: Tested on Asus P4C800-E Deluxe and Intel Essentials D945GCLF2

rtc_cmos 00:03: RTC can wake from S4
rtc_cmos 00:03: rtc core: registered rtc_cmos as rtc0
rtc0: alarms up to one month, 114 bytes nvram, hpet irqs


Commit introducing bug:

commit abd6633c67925f90775bb74755f9c547e30f1f20
Author: David Härdeman <david@hardeman.nu>
Date:   Mon Sep 21 17:04:52 2009 -0700

    pnp: add a shutdown method to pnp drivers

    The shutdown method is used by the winbond cir driver to setup the
    hardware for wake-from-S5.

    Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
    Signed-off-by: David Härdeman <david@hardeman.nu>
    Cc: Dmitry Torokhov <dtor@mail.ru>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


Although this patch doesn't apply to the rtc-cmos module directly, the added PNP shutdown function seems to cause the module to behave differently. Unfortunately i couldn't take a deeper look into the runtime changes this patch introduces.

Output of /proc/driver/rtc after setting alarm time:

rtc_time        : 00:07:25
rtc_date        : 2009-12-31
alrm_time       : 00:08:20
alrm_date       : 2009-12-31
alarm_IRQ       : yes
alrm_pending    : no
24hr            : yes
periodic_IRQ    : no
update_IRQ      : no
HPET_emulated   : yes
DST_enable      : no
periodic_freq   : 1024
batt_status     : okay


Output of /proc/driver/rtc after waiting for the alarm to trigger while the system stays on:

rtc_time        : 00:08:36
rtc_date        : 2009-12-31
alrm_time       : 00:08:20
alrm_date       : ****-**-31
alarm_IRQ       : no
alrm_pending    : no
24hr            : yes
periodic_IRQ    : no
update_IRQ      : no
HPET_emulated   : yes
DST_enable      : no
periodic_freq   : 1024
batt_status     : okay
Comment 1 Michael Meier 2009-12-30 23:19:00 UTC
Created attachment 24385 [details]
Kernel configuration for Intel Essentials D945GCLF2
Comment 2 Simon Munton 2010-01-04 22:52:26 UTC
Created attachment 24433 [details]
Restore wakealarm function on shutdown

With the addition of the shutdown method to the pnp drivers, the cmos_pnp_shutdown() function in rtc-cmos.c is no longer called on shutdown.

This patch makes the cmos_pnp_shutdown() function be called via the pnp driver shutdown method.
Comment 3 Andrew Morton 2010-01-06 23:54:24 UTC
Thanks, I seem to have recently merged /rtc_cmos-convert-shutdown-to-new-pnp_driver-shutdown.patch which does the same thing.

Note You need to log in before you can comment on or make changes to this bug.