From: alexanders83@web.de (Alexander Stein)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] pinctrl/at91: Fix lockup when IRQ on PIOC and PIOD occurs
Date: Wed, 23 Apr 2014 23:40:03 +0200 [thread overview]
Message-ID: <1398289203-2407-1-git-send-email-alexanders83@web.de> (raw)
With commit 8d56dfcc (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.
Signed-off-by: Alexander Stein <alexanders83@web.de>
---
drivers/pinctrl/pinctrl-at91.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index 64a8f8f..dd7d3e4 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -1468,6 +1468,7 @@ static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
static int at91_gpio_of_irq_setup(struct device_node *node,
struct at91_gpio_chip *at91_gpio)
{
+ struct at91_gpio_chip *prev = NULL;
struct irq_data *d = irq_get_irq_data(at91_gpio->pioc_virq);
int ret;
@@ -1493,6 +1494,17 @@ static int at91_gpio_of_irq_setup(struct device_node *node,
panic("at91_gpio.%d: couldn't allocate irq domain (DT).\n",
at91_gpio->pioc_idx);
+ /* Setup chained handler */
+ if (at91_gpio->pioc_idx)
+ prev = gpio_chips[at91_gpio->pioc_idx - 1];
+
+ /* The top level handler handles one bank of GPIOs, except
+ * on some SoC it can handle up to three...
+ * We only set up the handler for the first of the list.
+ */
+ if (prev && prev->next == at91_gpio)
+ return 0;
+
/* Then register the chain on the parent IRQ */
gpiochip_set_chained_irqchip(&at91_gpio->chip,
&gpio_irqchip,
--
1.9.2
next reply other threads:[~2014-04-23 21:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-23 21:40 Alexander Stein [this message]
2014-04-23 22:34 ` [PATCH] pinctrl/at91: Fix lockup when IRQ on PIOC and PIOD occurs Alexander Stein
2014-04-24 17:55 ` [PATCH v2] " Alexander Stein
2014-04-25 9:18 ` Linus Walleij
2014-05-09 10:23 ` Nicolas Ferre
2014-05-21 17:15 ` Alexandre Belloni
2014-05-27 9:13 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1398289203-2407-1-git-send-email-alexanders83@web.de \
--to=alexanders83@web.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).