Skip to content

Commit 04eaae7

Browse files
esbengregkh
authored andcommitted
rtc: interface: Ensure alarm irq is enabled when UIE is enabled
commit 9db26d5 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 <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent cbcfb32 commit 04eaae7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/rtc/interface.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,10 @@ int rtc_update_irq_enable(struct rtc_device *rtc, unsigned int enabled)
594594
rtc->uie_rtctimer.node.expires = ktime_add(now, onesec);
595595
rtc->uie_rtctimer.period = ktime_set(1, 0);
596596
err = rtc_timer_enqueue(rtc, &rtc->uie_rtctimer);
597+
if (!err && rtc->ops && rtc->ops->alarm_irq_enable)
598+
err = rtc->ops->alarm_irq_enable(rtc->dev.parent, 1);
599+
if (err)
600+
goto out;
597601
} else {
598602
rtc_timer_remove(rtc, &rtc->uie_rtctimer);
599603
}

0 commit comments

Comments
 (0)