]> git.karo-electronics.de Git - linux-beck.git/commitdiff
rtc-cmos: report wakeups from interrupt handler
authorPaul Fox <pgf@laptop.org>
Mon, 16 Jul 2012 19:56:26 +0000 (21:56 +0200)
committerRafael J. Wysocki <rjw@sisk.pl>
Tue, 17 Jul 2012 20:14:48 +0000 (22:14 +0200)
When suspending the system with an important RTC wake alarm active,
it is possible that the RTC alarm will expire before the system has
gone to sleep (e.g. short alarm timer, or an unusually long suspend
routine).

If this happens, the RTC alarm should trigger a wakeup event, possibly
aborting system suspend. This condition can be detected in the form
of an RTC alarm interrupt.

Signed-off-by: Paul Fox <pgf@laptop.org>
Signed-off-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
drivers/rtc/rtc-cmos.c

index 4267789ca9959413e90df5ea053154e07481d3ce..132333d754085d6b06a9c096444a95b708e45893 100644 (file)
@@ -568,6 +568,7 @@ static irqreturn_t cmos_interrupt(int irq, void *p)
                hpet_mask_rtc_irq_bit(RTC_AIE);
 
                CMOS_READ(RTC_INTR_FLAGS);
+               pm_wakeup_event(cmos_rtc.dev, 0);
        }
        spin_unlock(&rtc_lock);