Re: [PATCH v2] gpio: pca953x: fix IRQ storm on system wake up
From: Andy Shevchenko
Date: Fri May 09 2025 - 11:10:32 EST
On Fri, May 09, 2025 at 04:18:28PM +0200, Francesco Dolcini wrote:
> From: Emanuele Ghidoli <emanuele.ghidoli@xxxxxxxxxxx>
>
> If an input changes state during wake-up and is used as an interrupt
> source, the IRQ handler reads the volatile input register to clear the
> interrupt mask and deassert the IRQ line. However, the IRQ handler is
> triggered before access to the register is granted, causing the read
> operation to fail.
>
> As a result, the IRQ handler enters a loop, repeatedly printing the
> "failed reading register" message, until `pca953x_resume` is eventually
`pca953x_resume` --> pca953x_resume()
> called, which restores the driver context and enables access to
> registers.
>
> Fix by disabling the IRQ line before entering suspend mode, and
> re-enabling it after the driver context is restored in `pca953x_resume`.
`pca953x_resume` --> pca953x_resume()
> An irq can be disabled with disable_irq() and still wake the system as
IRQ
> long as the irq has wake enabled, so the wake-up functionality is
IRQ
> preserved.
With above fixed,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
thanks!
--
With Best Regards,
Andy Shevchenko