aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-03-27 13:02:39 -0400
committerThomas Gleixner <tglx@linutronix.de>2014-03-31 05:12:57 -0400
commit1b422ecd27866985b9f35d0d2b5ae6e9122dd4c0 (patch)
treeac35aeb574347061db21ee7d5405efaf265bb702
parent536a44d4277709303755e6365a059f54f4aa5403 (diff)
irqchip: sun7i/sun6i: Disable NMI before registering the handler
It is advisable to disable the NMI before registering the IRQ handler as registering the IRQ handler unmasks the IRQ on the GIC, so if U-Boot has left the NMI enabled and the NMI pin is active we will immediately get an interrupt before any driver has claimed the downstream interrupt of the NMI. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Carlo Caione <carlo@caione.org> Cc: maxime.ripard@free-electrons.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-sunxi@googlegroups.com Link: http://lkml.kernel.org/r/1395939759-11135-3-git-send-email-carlo@caione.org Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--drivers/irqchip/irq-sunxi-nmi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/irqchip/irq-sunxi-nmi.c b/drivers/irqchip/irq-sunxi-nmi.c
index 1c8566c638e1..12f547a44ae4 100644
--- a/drivers/irqchip/irq-sunxi-nmi.c
+++ b/drivers/irqchip/irq-sunxi-nmi.c
@@ -179,12 +179,12 @@ static int __init sunxi_sc_nmi_irq_init(struct device_node *node,
179 gc->chip_types[1].regs.type = reg_offs->ctrl; 179 gc->chip_types[1].regs.type = reg_offs->ctrl;
180 gc->chip_types[1].handler = handle_edge_irq; 180 gc->chip_types[1].handler = handle_edge_irq;
181 181
182 irq_set_handler_data(irq, domain);
183 irq_set_chained_handler(irq, sunxi_sc_nmi_handle_irq);
184
185 sunxi_sc_nmi_write(gc, reg_offs->enable, 0); 182 sunxi_sc_nmi_write(gc, reg_offs->enable, 0);
186 sunxi_sc_nmi_write(gc, reg_offs->pend, 0x1); 183 sunxi_sc_nmi_write(gc, reg_offs->pend, 0x1);
187 184
185 irq_set_handler_data(irq, domain);
186 irq_set_chained_handler(irq, sunxi_sc_nmi_handle_irq);
187
188 return 0; 188 return 0;
189 189
190fail_irqd_remove: 190fail_irqd_remove: