aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/pinctrl-at91.c
diff options
context:
space:
mode:
authorAlexander Stein <alexanders83@web.de>2014-04-24 13:55:39 -0400
committerLinus Walleij <linus.walleij@linaro.org>2014-05-27 05:13:10 -0400
commitcccb0c3e6a3feae761adbb34d74c1b9abb77ba4c (patch)
tree3f551330c27407d12692538437f35cd15ec0bac5 /drivers/pinctrl/pinctrl-at91.c
parentcdcb0ab63052b0b509013abfb9be1cc9175767f1 (diff)
pinctrl/at91: Fix lockup when IRQ on PIOC and PIOD occurs
With commit 80cc3732 (pinctrl/at91: convert driver to use gpiolib irqchip) gpiochip_set_chained_irqchip is called for PIOC, PIOD and PIOE. The associated GPIO chip for the IRQ chip is overwritten each time, because they share the same hard IRQ line. Thus if an IRQ occurs on PIOC or PIOD, gpio_irq_handler will only check on PIOE (the assigned GPIO chip) where no event occured. Thus the IRQ will not be cleared, retriggering the ISR. Fix that (like done before) by only set the PIOC GPIO chip to the IRQ chip and walk the list in the irq handler. Signed-off-by: Alexander Stein <alexanders83@web.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-at91.c')
-rw-r--r--drivers/pinctrl/pinctrl-at91.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index 84a9594a0caa..421493cb490c 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -1453,6 +1453,7 @@ static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
1453 break; 1453 break;
1454 at91_gpio = at91_gpio->next; 1454 at91_gpio = at91_gpio->next;
1455 pio = at91_gpio->regbase; 1455 pio = at91_gpio->regbase;
1456 gpio_chip = &at91_gpio->chip;
1456 continue; 1457 continue;
1457 } 1458 }
1458 1459
@@ -1468,6 +1469,7 @@ static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
1468static int at91_gpio_of_irq_setup(struct device_node *node, 1469static int at91_gpio_of_irq_setup(struct device_node *node,
1469 struct at91_gpio_chip *at91_gpio) 1470 struct at91_gpio_chip *at91_gpio)
1470{ 1471{
1472 struct at91_gpio_chip *prev = NULL;
1471 struct irq_data *d = irq_get_irq_data(at91_gpio->pioc_virq); 1473 struct irq_data *d = irq_get_irq_data(at91_gpio->pioc_virq);
1472 int ret; 1474 int ret;
1473 1475
@@ -1493,6 +1495,17 @@ static int at91_gpio_of_irq_setup(struct device_node *node,
1493 panic("at91_gpio.%d: couldn't allocate irq domain (DT).\n", 1495 panic("at91_gpio.%d: couldn't allocate irq domain (DT).\n",
1494 at91_gpio->pioc_idx); 1496 at91_gpio->pioc_idx);
1495 1497
1498 /* Setup chained handler */
1499 if (at91_gpio->pioc_idx)
1500 prev = gpio_chips[at91_gpio->pioc_idx - 1];
1501
1502 /* The top level handler handles one bank of GPIOs, except
1503 * on some SoC it can handle up to three...
1504 * We only set up the handler for the first of the list.
1505 */
1506 if (prev && prev->next == at91_gpio)
1507 return 0;
1508
1496 /* Then register the chain on the parent IRQ */ 1509 /* Then register the chain on the parent IRQ */
1497 gpiochip_set_chained_irqchip(&at91_gpio->chip, 1510 gpiochip_set_chained_irqchip(&at91_gpio->chip,
1498 &gpio_irqchip, 1511 &gpio_irqchip,