mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] gpio: omap: Fix double trigger for level interrupts
@ 2024-03-26 14:50 Markus Schneider-Pargmann
  2024-03-26 15:29 ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Schneider-Pargmann @ 2024-03-26 14:50 UTC (permalink / raw)
  To: Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Linus Walleij, Bartosz Golaszewski
  Cc: linux-omap, linux-gpio, linux-kernel, Markus Schneider-Pargmann,
	Markus Mirevik

Set gpio trigger before clearing the irq status.

This patch was originally proposed by Grygorii Strashko.

Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Reported-by: Markus Mirevik <markus.mirevik@dpsolutions.se>
Closes: https://lore.kernel.org/all/20220122235959.GA10737@sol/T/
Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
---
Hi everyone,

this patch helped me on the beagleboneblack to remove the mentioned
double trigger of level interrupts. This diff was proposed by Grygorii
in the thread linked in the commit message. I am not sure why this never
made it into the kernel, that's why I sending this patch. I did not
create the diff just made a patch out of it, I don't care about being
the author but I would be happy if this would get merged or some other
solution to the problem.

Thanks!

Best
Markus

 drivers/gpio/gpio-omap.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 76d5d87e9681..74b8fe2995e1 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -696,6 +696,9 @@ static void omap_gpio_unmask_irq(struct irq_data *d)
 	raw_spin_lock_irqsave(&bank->lock, flags);
 	omap_set_gpio_irqenable(bank, offset, 1);
 
+	if (trigger)
+		omap_set_gpio_triggering(bank, offset, trigger);
+
 	/*
 	 * For level-triggered GPIOs, clearing must be done after the source
 	 * is cleared, thus after the handler has run. OMAP4 needs this done
@@ -705,9 +708,6 @@ static void omap_gpio_unmask_irq(struct irq_data *d)
 	    trigger & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW))
 		omap_clear_gpio_irqstatus(bank, offset);
 
-	if (trigger)
-		omap_set_gpio_triggering(bank, offset, trigger);
-
 	raw_spin_unlock_irqrestore(&bank->lock, flags);
 }
 
-- 
2.43.0


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

end of thread, other threads:[~2024-03-26 16:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-26 14:50 [PATCH] gpio: omap: Fix double trigger for level interrupts Markus Schneider-Pargmann
2024-03-26 15:29 ` Dan Carpenter
2024-03-26 16:13   ` Markus Schneider-Pargmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®