irqchip/sunxi-nmi: Document interrupt disabling and clearing at probe time
authorChen-Yu Tsai <wens@csie.org>
Tue, 6 Jun 2017 05:59:24 +0000 (13:59 +0800)
committerMarc Zyngier <marc.zyngier@arm.com>
Thu, 22 Jun 2017 13:06:17 +0000 (14:06 +0100)
The sunxi-nmi disables all its interrupts and clears any pending
interrupts at probe time.

Add comments documenting it, just to make it clear.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
drivers/irqchip/irq-sunxi-nmi.c

index 177efb473c7d23ee1340b54adab3db68393fe1bf..9a7f6971cc3a152d8a794648b1fe164e01b0b09c 100644 (file)
@@ -201,7 +201,10 @@ 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;
 
+       /* Disable any active interrupts */
        sunxi_sc_nmi_write(gc, reg_offs->enable, 0);
+
+       /* Clear any pending NMI interrupts */
        sunxi_sc_nmi_write(gc, reg_offs->pend, SUNXI_NMI_IRQ_BIT);
 
        irq_set_chained_handler_and_data(irq, sunxi_sc_nmi_handle_irq, domain);