Skip to content

Commit

Permalink
ARM: LPC32xx: Relocate calls to irq_set_chained_handler()
Browse files Browse the repository at this point in the history
This patch fixes the issue of an access to a yet uninitialized data structure
at the point where irq_set_chained_handler() was called by moving the
respective calls to the end of lpc32xx_init_irq().

The call path was:

irq_set_chained_handler()
-> __irq_set_handler()
-> irq_startup()
-> irq_enable()
-> desc->irq_data.chip->irq_unmask()

at which point lpc32xx_unmask_irq() effectively read desc->irq_data.hwirq which
was only later initialized.

Signed-off-by: Roland Stigge <stigge@antcom.de>
  • Loading branch information
Roland Stigge committed Nov 7, 2012
1 parent 2998b1d commit e40ec95
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arch/arm/mach-lpc32xx/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,6 @@ void __init lpc32xx_init_irq(void)
__raw_writel(0, LPC32XX_INTC_MASK(LPC32XX_SIC1_BASE));
__raw_writel(0, LPC32XX_INTC_MASK(LPC32XX_SIC2_BASE));

/* MIC SUBIRQx interrupts will route handling to the chain handlers */
irq_set_chained_handler(IRQ_LPC32XX_SUB1IRQ, lpc32xx_sic1_handler);
irq_set_chained_handler(IRQ_LPC32XX_SUB2IRQ, lpc32xx_sic2_handler);

/* Initially disable all wake events */
__raw_writel(0, LPC32XX_CLKPWR_P01_ER);
__raw_writel(0, LPC32XX_CLKPWR_INT_ER);
Expand Down Expand Up @@ -479,4 +475,8 @@ void __init lpc32xx_init_irq(void)
NULL);
if (!lpc32xx_mic_domain)
panic("Unable to add MIC irq domain\n");

/* MIC SUBIRQx interrupts will route handling to the chain handlers */
irq_set_chained_handler(IRQ_LPC32XX_SUB1IRQ, lpc32xx_sic1_handler);
irq_set_chained_handler(IRQ_LPC32XX_SUB2IRQ, lpc32xx_sic2_handler);
}

0 comments on commit e40ec95

Please sign in to comment.