* [PATCH] pinctrl: sunxi: use chained_irq_{enter, exit} for GIC compatibility
@ 2014-02-10 16:22 Chen-Yu Tsai
2014-02-12 19:22 ` Maxime Ripard
2014-02-24 13:29 ` Linus Walleij
0 siblings, 2 replies; 3+ messages in thread
From: Chen-Yu Tsai @ 2014-02-10 16:22 UTC (permalink / raw)
To: Linus Walleij, Maxime Ripard
Cc: Chen-Yu Tsai, linux-arm-kernel, linux-kernel, David Lanzendoerfer,
stable
On tha Allwinner A20 SoC, the external interrupts on the pin controller
device are connected to the GIC. Without chained_irq_{enter, exit},
external GPIO interrupts, such as used by mmc core card detect, cause
the system to hang.
Cc: stable@vger.kernel.org
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
This issue was first encountered during my attempt to get out-of-band
interrupts for WiFi on the Cubietruck working. With David's new series
of sunci-mci using mmc slot-gpio for (GPIO interrupt based) card
detection, removing the SD card also causes my Cubietruck to hang. This
problem should extend to all Allwinner A20 based boards.
With this fix, the system no longer hangs when I remove or insert the
SD card. /proc/interrupts show that the interrupt has correctly fired.
However the system still does not detect card removal/insertion. I
believe this is another unrelated issue.
drivers/pinctrl/pinctrl-sunxi.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/pinctrl/pinctrl-sunxi.c b/drivers/pinctrl/pinctrl-sunxi.c
index 9ccf681..787f352 100644
--- a/drivers/pinctrl/pinctrl-sunxi.c
+++ b/drivers/pinctrl/pinctrl-sunxi.c
@@ -14,6 +14,7 @@
#include <linux/clk.h>
#include <linux/gpio.h>
#include <linux/irqdomain.h>
+#include <linux/irqchip/chained_irq.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_address.h>
@@ -665,6 +666,7 @@ static struct irq_chip sunxi_pinctrl_irq_chip = {
static void sunxi_pinctrl_irq_handler(unsigned irq, struct irq_desc *desc)
{
+ struct irq_chip *chip = irq_get_chip(irq);
struct sunxi_pinctrl *pctl = irq_get_handler_data(irq);
const unsigned long reg = readl(pctl->membase + IRQ_STATUS_REG);
@@ -674,10 +676,12 @@ static void sunxi_pinctrl_irq_handler(unsigned irq, struct irq_desc *desc)
if (reg) {
int irqoffset;
+ chained_irq_enter(chip, desc);
for_each_set_bit(irqoffset, ®, SUNXI_IRQ_NUMBER) {
int pin_irq = irq_find_mapping(pctl->domain, irqoffset);
generic_handle_irq(pin_irq);
}
+ chained_irq_exit(chip, desc);
}
}
--
1.9.rc1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] pinctrl: sunxi: use chained_irq_{enter, exit} for GIC compatibility
2014-02-10 16:22 [PATCH] pinctrl: sunxi: use chained_irq_{enter, exit} for GIC compatibility Chen-Yu Tsai
@ 2014-02-12 19:22 ` Maxime Ripard
2014-02-24 13:29 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2014-02-12 19:22 UTC (permalink / raw)
To: Chen-Yu Tsai
Cc: Linus Walleij, linux-arm-kernel, linux-kernel,
David Lanzendoerfer, stable
[-- Attachment #1: Type: text/plain, Size: 580 bytes --]
On Tue, Feb 11, 2014 at 12:22:37AM +0800, Chen-Yu Tsai wrote:
> On tha Allwinner A20 SoC, the external interrupts on the pin controller
> device are connected to the GIC. Without chained_irq_{enter, exit},
> external GPIO interrupts, such as used by mmc core card detect, cause
> the system to hang.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Thanks!
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] pinctrl: sunxi: use chained_irq_{enter, exit} for GIC compatibility
2014-02-10 16:22 [PATCH] pinctrl: sunxi: use chained_irq_{enter, exit} for GIC compatibility Chen-Yu Tsai
2014-02-12 19:22 ` Maxime Ripard
@ 2014-02-24 13:29 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2014-02-24 13:29 UTC (permalink / raw)
To: Chen-Yu Tsai
Cc: Maxime Ripard, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, David Lanzendoerfer, stable
On Mon, Feb 10, 2014 at 5:22 PM, Chen-Yu Tsai <wens@csie.org> wrote:
> On tha Allwinner A20 SoC, the external interrupts on the pin controller
> device are connected to the GIC. Without chained_irq_{enter, exit},
> external GPIO interrupts, such as used by mmc core card detect, cause
> the system to hang.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Patch applied for fixes with Maxime's ACK.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-02-24 13:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-10 16:22 [PATCH] pinctrl: sunxi: use chained_irq_{enter, exit} for GIC compatibility Chen-Yu Tsai
2014-02-12 19:22 ` Maxime Ripard
2014-02-24 13:29 ` Linus Walleij
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).