aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorDerek Basehore <dbasehore@chromium.org>2013-06-12 17:04:45 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-06-12 19:29:45 -0400
commitebf8d6c8630bfd3e24683306599cb953c9a2842c (patch)
tree38bf89d51bd1d64d0afc9d3dc85968ad69991597 /drivers/rtc
parent5a280844bb3bcd79076cac6ad002f71d25c798e5 (diff)
drivers/rtc/rtc-cmos.c: fix accidentally enabling rtc channel
During resume, we call hpet_rtc_timer_init after masking an irq bit in hpet. This will cause the call to hpet_disable_rtc_channel to be undone if RTC_AIE is the only bit not masked. Allowing the cmos interrupt handler to run before resuming caused some issues where the timer for the alarm was not removed. This would cause other, later timers to not be cleared, so utilities such as hwclock would time out when waiting for the update interrupt. [akpm@linux-foundation.org: coding-style tweak] Signed-off-by: Derek Basehore <dbasehore@chromium.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-cmos.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index cc5bea9c4b1c..f1cb706445c7 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -854,6 +854,9 @@ static int cmos_resume(struct device *dev)
854 } 854 }
855 855
856 spin_lock_irq(&rtc_lock); 856 spin_lock_irq(&rtc_lock);
857 if (device_may_wakeup(dev))
858 hpet_rtc_timer_init();
859
857 do { 860 do {
858 CMOS_WRITE(tmp, RTC_CONTROL); 861 CMOS_WRITE(tmp, RTC_CONTROL);
859 hpet_set_rtc_irq_bit(tmp & RTC_IRQMASK); 862 hpet_set_rtc_irq_bit(tmp & RTC_IRQMASK);
@@ -869,7 +872,6 @@ static int cmos_resume(struct device *dev)
869 rtc_update_irq(cmos->rtc, 1, mask); 872 rtc_update_irq(cmos->rtc, 1, mask);
870 tmp &= ~RTC_AIE; 873 tmp &= ~RTC_AIE;
871 hpet_mask_rtc_irq_bit(RTC_AIE); 874 hpet_mask_rtc_irq_bit(RTC_AIE);
872 hpet_rtc_timer_init();
873 } while (mask & RTC_AIE); 875 } while (mask & RTC_AIE);
874 spin_unlock_irq(&rtc_lock); 876 spin_unlock_irq(&rtc_lock);
875 } 877 }