Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH v2 0/5] rtc: Fix problems with missing UIE irqs
@ 2025-05-16  7:23 Esben Haabendal
  2025-05-16  7:23 ` [PATCH v2 1/5] rtc: interface: Fix long-standing race when setting alarm Esben Haabendal
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Esben Haabendal @ 2025-05-16  7:23 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: linux-rtc, linux-kernel, linux-arm-kernel, Esben Haabendal,
	stable

This fixes a couple of different problems, that can cause RTC (alarm)
irqs to be missing when generating UIE interrupts.

The first commit fixes a long-standing problem, which has been
documented in a comment since 2010. This fixes a race that could cause
UIE irqs to stop being generated, which was easily reproduced by
timing the use of RTC_UIE_ON ioctl with the seconds tick in the RTC.

The last commit ensures that RTC (alarm) irqs are enabled whenever
RTC_UIE_ON ioctl is used.

The driver specific commits avoids kernel warnings about unbalanced
enable_irq/disable_irq, which gets triggered on first RTC_UIE_ON with
the last commit. Before this series, the same warning should be seen
on initial RTC_AIE_ON with those drivers.

Signed-off-by: Esben Haabendal <esben@geanix.com>
---
Changes in v2:
- Dropped patch for rtc-st-lpc driver.
- Link to v1: https://lore.kernel.org/r/20241203-rtc-uie-irq-fixes-v1-0-01286ecd9f3f@geanix.com

---
Esben Haabendal (5):
      rtc: interface: Fix long-standing race when setting alarm
      rtc: isl12022: Fix initial enable_irq/disable_irq balance
      rtc: cpcap: Fix initial enable_irq/disable_irq balance
      rtc: tps6586x: Fix initial enable_irq/disable_irq balance
      rtc: interface: Ensure alarm irq is enabled when UIE is enabled

 drivers/rtc/interface.c    | 27 +++++++++++++++++++++++++++
 drivers/rtc/rtc-cpcap.c    |  1 +
 drivers/rtc/rtc-isl12022.c |  1 +
 drivers/rtc/rtc-tps6586x.c |  1 +
 4 files changed, 30 insertions(+)
---
base-commit: 82f2b0b97b36ee3fcddf0f0780a9a0825d52fec3
change-id: 20241203-rtc-uie-irq-fixes-f2838782d0f8

Best regards,
-- 
Esben Haabendal <esben@geanix.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-11 16:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-16  7:23 [PATCH v2 0/5] rtc: Fix problems with missing UIE irqs Esben Haabendal
2025-05-16  7:23 ` [PATCH v2 1/5] rtc: interface: Fix long-standing race when setting alarm Esben Haabendal
2025-05-16  7:23 ` [PATCH v2 5/5] rtc: interface: Ensure alarm irq is enabled when UIE is enabled Esben Haabendal
2025-10-11 16:21 ` [PATCH v2 0/5] rtc: Fix problems with missing UIE irqs Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox