From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Francesco Dolcini <francesco@dolcini.it>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Emanuele Ghidoli <emanuele.ghidoli@toradex.com>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Marek Vasut <marek.vasut@gmail.com>,
Geert Uytterhoeven <geert@linux-m68k.org>,
stable@vger.kernel.org,
Francesco Dolcini <francesco.dolcini@toradex.com>
Subject: Re: [PATCH v2] gpio: pca953x: fix IRQ storm on system wake up
Date: Fri, 9 May 2025 18:08:00 +0300 [thread overview]
Message-ID: <aB4aUAVONloIK0E0@smile.fi.intel.com> (raw)
In-Reply-To: <20250509141828.57851-1-francesco@dolcini.it>
On Fri, May 09, 2025 at 04:18:28PM +0200, Francesco Dolcini wrote:
> From: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
>
> 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@linux.intel.com>
thanks!
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2025-05-09 15:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-09 14:18 [PATCH v2] gpio: pca953x: fix IRQ storm on system wake up Francesco Dolcini
2025-05-09 15:08 ` Andy Shevchenko [this message]
2025-05-12 9:17 ` Geert Uytterhoeven
2025-05-12 9:23 ` Andy Shevchenko
2025-05-12 9:38 ` Emanuele Ghidoli
2025-05-12 9:42 ` Geert Uytterhoeven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aB4aUAVONloIK0E0@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=brgl@bgdev.pl \
--cc=emanuele.ghidoli@toradex.com \
--cc=francesco.dolcini@toradex.com \
--cc=francesco@dolcini.it \
--cc=geert@linux-m68k.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marek.vasut@gmail.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.