On 14/09/2021 11:02:55+0300, Ville Syrjälä wrote: > On Sun, Sep 12, 2021 at 02:42:14PM +0200, Mateusz Jończyk wrote: > > Revert > > commit 6950d046eb6e ("rtc: cmos: Replace spin_lock_irqsave with spin_lock in hard IRQ") > > and add a comment. > > > > As described in a previous > > commit 66e4f4a9cc38 ("rtc: cmos: Use spin_lock_irqsave() in cmos_interrupt()") > > from February 2020: > > > > cmos_interrupt() isn't always called from hardirq context, so > > we must use spin_lock_irqsave() & co. > > > > Indeed, cmos_interrupt() is called from cmos_check_wkalrm(), which is > > called from cmos_resume() - apparently not in an interrupt context. > > > > A later > > commit 6950d046eb6e ("rtc: cmos: Replace spin_lock_irqsave with spin_lock in hard IRQ") > > did not take account of this and changed spin_lock_irqsave() to spin_lock(). > > This may cause a deadlock as quoted in the body of > > commit 66e4f4a9cc38 ("rtc: cmos: Use spin_lock_irqsave() in cmos_interrupt()") > > mentioned earlier. > > This regression was supposed to be fixed by > https://lore.kernel.org/linux-rtc/20210305122140.28774-1-chris@xxxxxxxxxxxxxxxxxx/ > > What happened to that one? I don't see it in Linus's tree... > Yes, that's exactly what I was wondering when seeing that patch and it still sits in my rtc-fixes branch that I forgot to send to Linus... -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com