]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
pinctrl/amd: only handle irq if it is pending and unmasked
authorDaniel Kurtz <djkurtz@chromium.org>
Tue, 17 Jul 2018 00:57:18 +0000 (18:57 -0600)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:47:46 +0000 (19:47 -0600)
commite9e1b2fa454eb1760483746ab7bf9ff1661f0282
tree933de16298796712da602b1132ef41b1a40ce809
parentaf96b50fb0903a29ec80ea99599033dd68ec6b5a
pinctrl/amd: only handle irq if it is pending and unmasked

BugLink: https://bugs.launchpad.net/bugs/1836117
[ Upstream commit 8bbed1eef001fdfc0ee9595f64cc4f769d265af4 ]

The AMD pinctrl driver demultiplexes GPIO interrupts and fires off their
individual handlers.

If one of these GPIO irqs is configured as a level interrupt, and its
downstream handler is a threaded ONESHOT interrupt, the GPIO interrupt
source is masked by handle_level_irq() until the eventual return of the
threaded irq handler.  During this time the level GPIO interrupt status
will still report as high until the actual gpio source is cleared - both
in the individual GPIO interrupt status bit (INTERRUPT_STS_OFF) and in
its corresponding "WAKE_INT_STATUS_REG" bit.

Thus, if another GPIO interrupt occurs during this time,
amd_gpio_irq_handler() will see that the (masked-and-not-yet-cleared)
level irq is still pending and incorrectly call its handler again.

To fix this, have amd_gpio_irq_handler() check for both interrupts status
and mask before calling generic_handle_irq().

Note: Is it possible that this bug was the source of the interrupt storm
on Ryzen when using chained interrupts before commit ba714a9c1dea85
("pinctrl/amd: Use regular interrupt instead of chained")?

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/pinctrl/pinctrl-amd.c