From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934253AbdKGA3g (ORCPT ); Mon, 6 Nov 2017 19:29:36 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:54049 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933284AbdKGA3d (ORCPT ); Mon, 6 Nov 2017 19:29:33 -0500 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "=?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?=" , "Linus Walleij" Date: Mon, 06 Nov 2017 23:03:02 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 088/294] gpio: tegra: fix unbalanced chained_irq_enter/exit In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.50-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Michał Mirosław 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.16: adjust context] Signed-off-by: Ben Hutchings --- drivers/gpio/gpio-tegra.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c @@ -271,7 +271,7 @@ static void tegra_gpio_irq_handler(unsig 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); @@ -291,8 +291,8 @@ static void tegra_gpio_irq_handler(unsig * 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); }