diff options
author | NeilBrown <neilb@suse.de> | 2012-08-05 22:56:20 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-08-08 20:49:16 +0200 |
commit | 7523ceed42d84c1afaa1dc498bffed53c2aa444e (patch) | |
tree | 3da6d7ea253851657b49413001c8512871a86f96 /drivers/rtc/rtc-cmos.c | |
parent | 0d7614f09c1ebdbaa1599a5aba7593f147bf96ee (diff) | |
download | linux-7523ceed42d84c1afaa1dc498bffed53c2aa444e.tar.gz linux-7523ceed42d84c1afaa1dc498bffed53c2aa444e.tar.bz2 linux-7523ceed42d84c1afaa1dc498bffed53c2aa444e.zip |
RTC: Avoid races between RTC alarm wakeup and suspend.
If an RTC alarm fires just as suspend is happening, it is possible for
suspend to complete and the alarm to be missed.
To avoid the race, we must register the event with the PM core.
As the event is made visible to userspace through a thread which is
only scheduled by the interrupt, we need a pm_stay_awake/pm_relax
pair preventing suspend from the interrupt until the thread completes
its work.
This makes the pm_wakeup_event() call in cmos_interrupt unnecessary as
it provides suspend protection for all RTCs that use rtc_update_irq.
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/rtc/rtc-cmos.c')
-rw-r--r-- | drivers/rtc/rtc-cmos.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c index 132333d75408..4267789ca995 100644 --- a/drivers/rtc/rtc-cmos.c +++ b/drivers/rtc/rtc-cmos.c @@ -568,7 +568,6 @@ 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); |