mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-25 13:14:07 +08:00
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>
This commit is contained in:
parent
5a280844bb
commit
ebf8d6c863
@ -854,6 +854,9 @@ static int cmos_resume(struct device *dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
spin_lock_irq(&rtc_lock);
|
spin_lock_irq(&rtc_lock);
|
||||||
|
if (device_may_wakeup(dev))
|
||||||
|
hpet_rtc_timer_init();
|
||||||
|
|
||||||
do {
|
do {
|
||||||
CMOS_WRITE(tmp, RTC_CONTROL);
|
CMOS_WRITE(tmp, RTC_CONTROL);
|
||||||
hpet_set_rtc_irq_bit(tmp & RTC_IRQMASK);
|
hpet_set_rtc_irq_bit(tmp & RTC_IRQMASK);
|
||||||
@ -869,7 +872,6 @@ static int cmos_resume(struct device *dev)
|
|||||||
rtc_update_irq(cmos->rtc, 1, mask);
|
rtc_update_irq(cmos->rtc, 1, mask);
|
||||||
tmp &= ~RTC_AIE;
|
tmp &= ~RTC_AIE;
|
||||||
hpet_mask_rtc_irq_bit(RTC_AIE);
|
hpet_mask_rtc_irq_bit(RTC_AIE);
|
||||||
hpet_rtc_timer_init();
|
|
||||||
} while (mask & RTC_AIE);
|
} while (mask & RTC_AIE);
|
||||||
spin_unlock_irq(&rtc_lock);
|
spin_unlock_irq(&rtc_lock);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user