diff mbox series

gpio: tegra: mask GPIO IRQs during IRQ shutdown

Message ID 20200427232605.11608-1-swarren@wwwdotorg.org
State Deferred
Headers show
Series gpio: tegra: mask GPIO IRQs during IRQ shutdown | expand

Commit Message

Stephen Warren April 27, 2020, 11:26 p.m. UTC
From: Stephen Warren <swarren@nvidia.com>

The driver currently leaves GPIO IRQs unmasked even when the GPIO IRQ
client has released the GPIO IRQ. This allows the HW to raise IRQs, and
SW to process them, after shutdown. Fix this by masking the IRQ when it's
shut down. This is usually taken care of by the irqchip core, but since
this driver has a custom irq_shutdown implementation, it must do this
explicitly itself.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 drivers/gpio/gpio-tegra.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Linus Walleij April 28, 2020, 2:22 p.m. UTC | #1
On Tue, Apr 28, 2020 at 1:26 AM Stephen Warren <swarren@wwwdotorg.org> wrote:

> From: Stephen Warren <swarren@nvidia.com>
>
> The driver currently leaves GPIO IRQs unmasked even when the GPIO IRQ
> client has released the GPIO IRQ. This allows the HW to raise IRQs, and
> SW to process them, after shutdown. Fix this by masking the IRQ when it's
> shut down. This is usually taken care of by the irqchip core, but since
> this driver has a custom irq_shutdown implementation, it must do this
> explicitly itself.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>

Patch applied for fixes.

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index acb99eff9939..86568154cdb3 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -368,6 +368,7 @@  static void tegra_gpio_irq_shutdown(struct irq_data *d)
 	struct tegra_gpio_info *tgi = bank->tgi;
 	unsigned int gpio = d->hwirq;
 
+	tegra_gpio_irq_mask(d);
 	gpiochip_unlock_as_irq(&tgi->gc, gpio);
 }