diff options
author | Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> | 2014-01-23 18:10:32 -0500 |
---|---|---|
committer | Jason Cooper <jason@lakedaemon.net> | 2014-02-06 13:03:32 -0500 |
commit | e0318ec3bf3f1502cd11b21b1eb00aa355b40b67 (patch) | |
tree | 8b2564dd13d7862ee0f11839a66c8c76eaddc208 /drivers/irqchip | |
parent | 5f40067fc86f0e49329ad4a852c278998ff4394e (diff) |
irqchip: orion: clear stale interrupts in irq_startup
Bridge IRQ_CAUSE bits are asserted regardless of the corresponding bit in
IRQ_MASK register. To avoid interrupt events on stale irqs, we have to clear
them before unmask. This installs an .irq_startup callback to ensure stale
irqs are cleared before initial unmask.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Cc: <stable@vger.kernel.org>: f56c0738b5c2: "irqchip: orion: clear bridge cause register on init"
Cc: <stable@vger.kernel.org>: 38bd80b84fca: "irqchip: orion: use handle_edge_irq on bridge irqs"
Cc: <stable@vger.kernel.org> # v3.10+
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Diffstat (limited to 'drivers/irqchip')
-rw-r--r-- | drivers/irqchip/irq-orion.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/irqchip/irq-orion.c b/drivers/irqchip/irq-orion.c index 1f636f719065..0dfdc5c824a1 100644 --- a/drivers/irqchip/irq-orion.c +++ b/drivers/irqchip/irq-orion.c | |||
@@ -123,6 +123,19 @@ static void orion_bridge_irq_handler(unsigned int irq, struct irq_desc *desc) | |||
123 | } | 123 | } |
124 | } | 124 | } |
125 | 125 | ||
126 | /* | ||
127 | * Bridge IRQ_CAUSE is asserted regardless of IRQ_MASK register. | ||
128 | * To avoid interrupt events on stale irqs, we clear them before unmask. | ||
129 | */ | ||
130 | static unsigned int orion_bridge_irq_startup(struct irq_data *d) | ||
131 | { | ||
132 | struct irq_chip_type *ct = irq_data_get_chip_type(d); | ||
133 | |||
134 | ct->chip.irq_ack(d); | ||
135 | ct->chip.irq_unmask(d); | ||
136 | return 0; | ||
137 | } | ||
138 | |||
126 | static int __init orion_bridge_irq_init(struct device_node *np, | 139 | static int __init orion_bridge_irq_init(struct device_node *np, |
127 | struct device_node *parent) | 140 | struct device_node *parent) |
128 | { | 141 | { |
@@ -176,6 +189,7 @@ static int __init orion_bridge_irq_init(struct device_node *np, | |||
176 | 189 | ||
177 | gc->chip_types[0].regs.ack = ORION_BRIDGE_IRQ_CAUSE; | 190 | gc->chip_types[0].regs.ack = ORION_BRIDGE_IRQ_CAUSE; |
178 | gc->chip_types[0].regs.mask = ORION_BRIDGE_IRQ_MASK; | 191 | gc->chip_types[0].regs.mask = ORION_BRIDGE_IRQ_MASK; |
192 | gc->chip_types[0].chip.irq_startup = orion_bridge_irq_startup; | ||
179 | gc->chip_types[0].chip.irq_ack = irq_gc_ack_clr_bit; | 193 | gc->chip_types[0].chip.irq_ack = irq_gc_ack_clr_bit; |
180 | gc->chip_types[0].chip.irq_mask = irq_gc_mask_clr_bit; | 194 | gc->chip_types[0].chip.irq_mask = irq_gc_mask_clr_bit; |
181 | gc->chip_types[0].chip.irq_unmask = irq_gc_mask_set_bit; | 195 | gc->chip_types[0].chip.irq_unmask = irq_gc_mask_set_bit; |