84710c63281a43b9c13961fb67553e80761f5ebc
[openwrt/openwrt.git] / target / linux / sunxi / patches-3.13 / 171-2-pinctrl-sunxi-fix-hang-on-gpio-irq.patch
1 From 613c8489f6b576166aa31d32cbd573f6b7952e06 Mon Sep 17 00:00:00 2001
2 From: Hans de Goede <hdegoede@redhat.com>
3 Date: Sat, 15 Feb 2014 12:58:17 +0100
4 Subject: [PATCH] pinctrl-sunxi: Fix hang on gpio irq
5
6 Our irq handler was missing chained_irq_enter / exit calls, causing a
7 hard hang as soon as a gpio irq happened.
8
9 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
10 ---
11 drivers/pinctrl/pinctrl-sunxi.c | 5 +++++
12 1 file changed, 5 insertions(+)
13
14 diff --git a/drivers/pinctrl/pinctrl-sunxi.c b/drivers/pinctrl/pinctrl-sunxi.c
15 index 74635cc..cc9bd1b 100644
16 --- a/drivers/pinctrl/pinctrl-sunxi.c
17 +++ b/drivers/pinctrl/pinctrl-sunxi.c
18 @@ -13,6 +13,7 @@
19 #include <linux/io.h>
20 #include <linux/clk.h>
21 #include <linux/gpio.h>
22 +#include <linux/irqchip/chained_irq.h>
23 #include <linux/irqdomain.h>
24 #include <linux/module.h>
25 #include <linux/of.h>
26 @@ -665,9 +666,12 @@ static void sunxi_pinctrl_irq_unmask(struct irq_data *d)
27
28 static void sunxi_pinctrl_irq_handler(unsigned irq, struct irq_desc *desc)
29 {
30 + struct irq_chip *chip = irq_get_chip(irq);
31 struct sunxi_pinctrl *pctl = irq_get_handler_data(irq);
32 const unsigned long reg = readl(pctl->membase + IRQ_STATUS_REG);
33
34 + chained_irq_enter(chip, desc);
35 +
36 /* Clear all interrupts */
37 writel(reg, pctl->membase + IRQ_STATUS_REG);
38
39 @@ -679,6 +683,7 @@ static void sunxi_pinctrl_irq_handler(unsigned irq, struct irq_desc *desc)
40 generic_handle_irq(pin_irq);
41 }
42 }
43 + chained_irq_exit(chip, desc);
44 }
45
46 static struct of_device_id sunxi_pinctrl_match[] = {
47 --
48 1.8.5.5
49