Skip to content

Commit

Permalink
gpio: tegra: fix unbalanced chained_irq_enter/exit
Browse files Browse the repository at this point in the history
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: 3c92db9
Signed-off-by: Michał Mirosław <[email protected]>
[Also changed the variable to a bool]
Signed-off-by: Linus Walleij <[email protected]>
  • Loading branch information
osctobe authored and linusw committed Aug 2, 2017
1 parent df1e76f commit 9e9509e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/gpio/gpio-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ static void tegra_gpio_irq_handler(struct irq_desc *desc)
{
int port;
int pin;
int unmasked = 0;
bool unmasked = false;
int gpio;
u32 lvl;
unsigned long sta;
Expand All @@ -384,8 +384,8 @@ 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)) {
unmasked = 1;
if (!unmasked && lvl & (0x100 << pin)) {
unmasked = true;
chained_irq_exit(chip, desc);
}

Expand Down

0 comments on commit 9e9509e

Please sign in to comment.