Skip to content

rtc: renesas-rtca3: Fix IRQ initialization and teardown ordering

Myeonghun Pak linux-renesas-soc linux-rtc lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2rtc: renesas-rtca3: Initialize the RTC before requesting interruptsdrivers/rtc/rtc-renesas-rtca3.c+6 -60 replies
2/2rtc: renesas-rtca3: Join interrupt handlers before unregistering the RTCdrivers/rtc/rtc-renesas-rtca3.c+22 -60 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] rtc: renesas-rtca3: Fix IRQ initialization and teardown ordering

The RTCA3 alarm handler passes priv->rtc_dev to rtc_update_irq(). Registering managed IRQs before allocating the managed RTC lets devres drop the RTC allocation reference before freeing and synchronizing the IRQs. Masking the hardware sources in remove also does not wait for an interrupt handler that has already entered.

Initialize the RTC before requesting IRQs so its allocation remains valid until managed IRQ teardown on removal and probe failure. Then stop both interrupt sources and synchronously disable both Linux IRQs in remove, before managed RTC unregistration. Serialize removal with RTC operations and reject later alarm enable or setup requests.

Compile-tested with Clang 22.1.2, W=1 (arm64). No runtime testing. One existing FIELD_GET comparison warning also occurs when compiling the unmodified driver with the same flags. No new compiler warnings.

Myeonghun Pak (2):
rtc: renesas-rtca3: Initialize the RTC before requesting interrupts
rtc: renesas-rtca3: Join interrupt handlers before unregistering the RTC

 drivers/rtc/rtc-renesas-rtca3.c | 40 ++++++++++++++++++++++++++++------------
 1 file changed, 28 insertions(+), 12 deletions(-)