Re: watchdog: pcf2127: systemd fails on 5.11

From: Alexandre Belloni
Date: Wed Feb 24 2021 - 10:40:23 EST


Hi,

On 24/02/2021 15:55:00+0100, Bruno Thomsen wrote:
> You could be right about that, I don't think the watchdog feature should
> be available for use if the alarm feature is enabled due to how CTRL2
> register behaves.
>
> The hardware I am testing on is a custom board, but it's actually
> possible to get a Raspberry Pi module called RasClock that has
> the chip.
>

I have an eval board for the PCF2127 (and PCF2129), the OM13513.

> I will test some locking around WD_VAL register access as that is used
> in pcf2127_wdt_ping function.
>
> My initial test shows that spin_lock_irqsave around regmap calls are not
> a good idea as it result in:
> BUG: scheduling while atomic: watchdog/70/0x00000002
> BUG: scheduling while atomic: systemd/1/0x00000002
>

The issue is not only regmap but the fact that i2C and spi accesses are
allowed to sleep.


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