mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-06 20:03:33 -04:00
rtc: interface: Ensure alarm irq is enabled when UIE is enabled
commit 9db26d5855d0374d4652487bfb5aacf40821c469 upstream. When setting a normal alarm, user-space is responsible for using RTC_AIE_ON/RTC_AIE_OFF to control if alarm irq should be enabled. But when RTC_UIE_ON is used, interrupts must be enabled so that the requested irq events are generated. When RTC_UIE_OFF is used, alarm irq is disabled if there are no other alarms queued, so this commit brings symmetry to that. Signed-off-by: Esben Haabendal <esben@geanix.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20250516-rtc-uie-irq-fixes-v2-5-3de8e530a39e@geanix.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
8613c9fb1c
commit
755e5a8ffb
1 changed files with 4 additions and 0 deletions
|
|
@ -577,6 +577,10 @@ int rtc_update_irq_enable(struct rtc_device *rtc, unsigned int enabled)
|
|||
rtc->uie_rtctimer.node.expires = ktime_add(now, onesec);
|
||||
rtc->uie_rtctimer.period = ktime_set(1, 0);
|
||||
err = rtc_timer_enqueue(rtc, &rtc->uie_rtctimer);
|
||||
if (!err && rtc->ops && rtc->ops->alarm_irq_enable)
|
||||
err = rtc->ops->alarm_irq_enable(rtc->dev.parent, 1);
|
||||
if (err)
|
||||
goto out;
|
||||
} else {
|
||||
rtc_timer_remove(rtc, &rtc->uie_rtctimer);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue