gpio: tegra: fix unbalanced chained_irq_enter/exit
diff mbox

Message ID a9c261800dbb662c9c703544817dc103e2937472.1500381146.git.mirq-linux@rere.qmqm.pl
State New
Headers show

Commit Message

Michał Mirosław July 18, 2017, 12:35 p.m. UTC
When more than one GPIO IRQs are triggered simultaneously,
tegra_gpio_irq_handler() called chained_irq_exit() multiple
times for one chained_irq_enter().

Fixes: 3c92db9ac0ca3eee8e46e2424b6c074e2e394ad9
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 drivers/gpio/gpio-tegra.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Linus Walleij Aug. 2, 2017, 8:43 a.m. UTC | #1
On Tue, Jul 18, 2017 at 2:35 PM, Michał Mirosław
<mirq-linux@rere.qmqm.pl> wrote:

> When more than one GPIO IRQs are triggered simultaneously,
> tegra_gpio_irq_handler() called chained_irq_exit() multiple
> times for one chained_irq_enter().
>
> Fixes: 3c92db9ac0ca3eee8e46e2424b6c074e2e394ad9
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>

Patch applied. I also changed this variable to a bool.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index 88529d3c06c9..4bd99a38cae8 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -384,7 +384,7 @@  static void tegra_gpio_irq_handler(struct irq_desc *desc)
 			 * before executing the handler so that we don't
 			 * miss edges
 			 */
-			if (lvl & (0x100 << pin)) {
+			if (!unmasked && lvl & (0x100 << pin)) {
 				unmasked = 1;
 				chained_irq_exit(chip, desc);
 			}