Re: [PATCH] rtc-cmos: use spin_lock_irqsave in cmos_interrupt

From: Alexandre Belloni
Date: Mon Jun 23 2025 - 18:29:38 EST


On Sat, 07 Jun 2025 23:06:08 +0200, Mateusz Jończyk wrote:
> cmos_interrupt() can be called in a non-interrupt context, such as in
> an ACPI event handler (which runs in an interrupt thread). Therefore,
> usage of spin_lock(&rtc_lock) is insecure. Use spin_lock_irqsave() /
> spin_unlock_irqrestore() instead.
>
> Before a misguided
> commit 6950d046eb6e ("rtc: cmos: Replace spin_lock_irqsave with spin_lock in hard IRQ")
> the cmos_interrupt() function used spin_lock_irqsave(). That commit
> changed it to spin_lock() and broke locking, which was partially fixed in
> commit 13be2efc390a ("rtc: cmos: Disable irq around direct invocation of cmos_interrupt()")
>
> [...]

Applied, thanks!

[1/1] rtc-cmos: use spin_lock_irqsave in cmos_interrupt
https://git.kernel.org/abelloni/c/00a39d8652ff

Best regards,

--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com