RE: [PATCH v1 1/1] regulator: da9211: Use irq handler when ready

From: DLG Adam Ward
Date: Sun Nov 27 2022 - 15:55:16 EST


On 24 November 2022 16:46, Ricardo Ribalda wrote:
>If the system does not come from reset (like when it is kexec()), the regulator might have an IRQ waiting for us.
>
>If we enable the IRQ handler before its structures are ready, we crash.

A good catch, thank you :-)

...
>+ ret = da9211_regulator_init(chip);
...
> chip->chip_irq = i2c->irq;

On the other hand... with the init call made before chip_irq is assigned, the IRQs won't be unmasked:
https://elixir.bootlin.com/linux/latest/source/drivers/regulator/da9211-regulator.c#L430

Nacked-by: Adam Ward <DLG-Adam.Ward.opensource@xxxxxxxxxxxxxx>

Regards,
Adam