Skip to content

Commit 1b422ec

Browse files
jwrdegoedeKAGA-KOKO
authored andcommitted
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 <[email protected]> Signed-off-by: Carlo Caione <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
1 parent 536a44d commit 1b422ec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/irqchip/irq-sunxi-nmi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,12 @@ static int __init sunxi_sc_nmi_irq_init(struct device_node *node,
179179
gc->chip_types[1].regs.type = reg_offs->ctrl;
180180
gc->chip_types[1].handler = handle_edge_irq;
181181

182-
irq_set_handler_data(irq, domain);
183-
irq_set_chained_handler(irq, sunxi_sc_nmi_handle_irq);
184-
185182
sunxi_sc_nmi_write(gc, reg_offs->enable, 0);
186183
sunxi_sc_nmi_write(gc, reg_offs->pend, 0x1);
187184

185+
irq_set_handler_data(irq, domain);
186+
irq_set_chained_handler(irq, sunxi_sc_nmi_handle_irq);
187+
188188
return 0;
189189

190190
fail_irqd_remove:

0 commit comments

Comments
 (0)