From 31c0eacab3d550945ced448b9e31280d0b9cc3e1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20Miros=C5=82aw?= Date: Tue, 18 Jul 2017 14:35:45 +0200 Subject: [PATCH] gpio: tegra: fix unbalanced chained_irq_enter/exit MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit commit 9e9509e38fbe034782339eb09c915f0b5765ff69 upstream. 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 [Also changed the variable to a bool] Signed-off-by: Linus Walleij [bwh: Backported to 3.2: adjust context] Signed-off-by: Ben Hutchings --- drivers/gpio/gpio-tegra.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index 61044c889f7f..9c84ad5ebd60 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c @@ -230,7 +230,7 @@ static void tegra_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) struct tegra_gpio_bank *bank; int port; int pin; - int unmasked = 0; + bool unmasked = false; struct irq_chip *chip = irq_desc_get_chip(desc); chained_irq_enter(chip, desc); @@ -250,8 +250,8 @@ static void tegra_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) * before executing the hander so that we don't * miss edges */ - if (lvl & (0x100 << pin)) { - unmasked = 1; + if (!unmasked && lvl & (0x100 << pin)) { + unmasked = true; chained_irq_exit(chip, desc); } -- 2.39.2