Skip to content

Commit

Permalink
irqchip: sun7i/sun6i: Disable NMI before registering the handler
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hans de Goede authored and Thomas Gleixner committed Mar 31, 2014
1 parent 536a44d commit 1b422ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/irqchip/irq-sunxi-nmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,12 @@ static int __init sunxi_sc_nmi_irq_init(struct device_node *node,
gc->chip_types[1].regs.type = reg_offs->ctrl;
gc->chip_types[1].handler = handle_edge_irq;

irq_set_handler_data(irq, domain);
irq_set_chained_handler(irq, sunxi_sc_nmi_handle_irq);

sunxi_sc_nmi_write(gc, reg_offs->enable, 0);
sunxi_sc_nmi_write(gc, reg_offs->pend, 0x1);

irq_set_handler_data(irq, domain);
irq_set_chained_handler(irq, sunxi_sc_nmi_handle_irq);

return 0;

fail_irqd_remove:
Expand Down

0 comments on commit 1b422ec

Please sign in to comment.