All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpio: tegra: mask GPIO IRQs during IRQ shutdown
@ 2020-04-27 23:26 ` Stephen Warren
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Warren @ 2020-04-27 23:26 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski
  Cc: Thierry Reding, Jonathan Hunter,
	linux-gpio-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA, Stephen Warren

From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

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-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 drivers/gpio/gpio-tegra.c | 1 +
 1 file changed, 1 insertion(+)

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);
 }
 
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] gpio: tegra: mask GPIO IRQs during IRQ shutdown
@ 2020-04-27 23:26 ` Stephen Warren
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Warren @ 2020-04-27 23:26 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski
  Cc: Thierry Reding, Jonathan Hunter, linux-gpio, linux-tegra, Stephen Warren

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(+)

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);
 }
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] gpio: tegra: mask GPIO IRQs during IRQ shutdown
  2020-04-27 23:26 ` Stephen Warren
  (?)
@ 2020-04-28 14:22 ` Linus Walleij
  -1 siblings, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2020-04-28 14:22 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Bartosz Golaszewski, Thierry Reding, Jonathan Hunter,
	open list:GPIO SUBSYSTEM, linux-tegra, Stephen Warren

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-28 14:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-27 23:26 [PATCH] gpio: tegra: mask GPIO IRQs during IRQ shutdown Stephen Warren
2020-04-27 23:26 ` Stephen Warren
2020-04-28 14:22 ` Linus Walleij

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.