[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aCG-DZI4fexZGy2H@smile.fi.intel.com>
Date: Mon, 12 May 2025 12:23:25 +0300
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Francesco Dolcini <francesco@...cini.it>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>,
Emanuele Ghidoli <emanuele.ghidoli@...adex.com>,
linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
Marek Vasut <marek.vasut@...il.com>, stable@...r.kernel.org,
Francesco Dolcini <francesco.dolcini@...adex.com>
Subject: Re: [PATCH v2] gpio: pca953x: fix IRQ storm on system wake up
On Mon, May 12, 2025 at 11:17:48AM +0200, Geert Uytterhoeven wrote:
> On Fri, 9 May 2025 at 16:18, Francesco Dolcini <francesco@...cini.it> wrote:
> >
> > 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
> > 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`.
> >
> > An irq can be disabled with disable_irq() and still wake the system as
> > long as the irq has wake enabled, so the wake-up functionality is
> > preserved.
...
> While this does not cause the regression seen on Salvator-XS with
> the earlier approach[1], I expect this will break using a GPIO as a
> wake-up source?
Good point! Have this code been checked for that kind of scenarios?
> [1] https://lore.kernel.org/linux-gpio/CAMuHMdVnKX23yi7ir1LVxfXAMeeWMFzM+cdgSSTNjpn1OnC2xw@mail.gmail.com
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists