The patch titled Fix crash with irqpoll due to the IRQF_IRQPOLL flag has been added to the -mm tree. Its filename is fix-crash-with-irqpoll-due-to-the-irqf_irqpoll-flag.patch *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: Fix crash with irqpoll due to the IRQF_IRQPOLL flag From: Bernhard Walle <bwalle@xxxxxxx> o System crashes if booted with irqpoll command line option. o Problem happens because Inside note_interrupt() we are accessing desc->action->flag without taking the desc->lock. While accessing it somebody goes ahead and unregisters the irq handler hence desc->action is NULL. By the time note_interrupt() checks it, it crashes. o In that system it is irq 4 serving the serial driver. o Take the desc->lock before accessing desc->action->flag. Signed-off-by: Bernhard Walle <bwalle@xxxxxxx> Signed-off-by: Vivek Goyal <vgoyal@xxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: Alan Cox <alan@xxxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/irq/spurious.c | 23 ++++++++++++++++++++--- 1 files changed, 20 insertions(+), 3 deletions(-) diff -puN kernel/irq/spurious.c~fix-crash-with-irqpoll-due-to-the-irqf_irqpoll-flag kernel/irq/spurious.c --- a/kernel/irq/spurious.c~fix-crash-with-irqpoll-due-to-the-irqf_irqpoll-flag +++ a/kernel/irq/spurious.c @@ -138,6 +138,8 @@ report_bad_irq(unsigned int irq, struct void note_interrupt(unsigned int irq, struct irq_desc *desc, irqreturn_t action_ret) { + int call_misrouted_irq = 0; + if (unlikely(action_ret != IRQ_HANDLED)) { desc->irqs_unhandled++; if (unlikely(action_ret != IRQ_NONE)) @@ -146,9 +148,24 @@ void note_interrupt(unsigned int irq, st if (unlikely(irqfixup)) { /* Don't punish working computers */ - if ((irqfixup == 2 && ((irq == 0) || - (desc->action->flags & IRQF_IRQPOLL))) || - action_ret == IRQ_NONE) { + if (action_ret == IRQ_NONE) + /* Nobody handled irq. Possibly a misrouted one. */ + call_misrouted_irq = 1; + else if (irqfixup == 2) { + /* irqpoll is enabled. Is this the irq driving + * polling. + */ + if (irq == 0) + call_misrouted_irq = 1; + else { + spin_lock(&desc->lock); + if (desc->action && + (desc->action->flags & IRQF_IRQPOLL)) + call_misrouted_irq = 1; + spin_unlock(&desc->lock); + } + } + if (call_misrouted_irq) { int ok = misrouted_irq(irq); if (action_ret == IRQ_NONE) desc->irqs_unhandled -= ok; _ Patches currently in -mm which might be from bwalle@xxxxxxx are git-r8169.patch scsi-remove-__gfp_dma.patch fix-crash-with-irqpoll-due-to-the-irqf_irqpoll-flag.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html