aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/irq
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2010-03-31 07:30:19 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-04-26 10:47:49 -0400
commitbfb7a32508e7b7af99ee9dc76c3d6d1a4a4eee10 (patch)
tree9f182687b4b74a7ca7af636469d20697299ef0fb /kernel/irq
parent235f60c1a10e7f14f200cc9148a93bb283f56074 (diff)
genirq: Force MSI irq handlers to run with interrupts disabled
commit 753649dbc49345a73a2454c770a3f2d54d11aec6 upstream. Network folks reported that directing all MSI-X vectors of their multi queue NICs to a single core can cause interrupt stack overflows when enough interrupts fire at the same time. This is caused by the fact that we run interrupt handlers by default with interrupts enabled unless the driver reuqests the interrupt with the IRQF_DISABLED set. The NIC handlers do not set this flag, so simultaneous interrupts can nest unlimited and cause the stack overflow. The only safe counter measure is to run the interrupt handlers with interrupts disabled. We can't switch to this mode in general right now, but it is safe to do so for MSI interrupts. Force IRQF_DISABLED for MSI interrupt handlers. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Andi Kleen <andi@firstfloor.org> Cc: Linus Torvalds <torvalds@osdl.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: David Miller <davem@davemloft.net> Cc: Greg Kroah-Hartman <gregkh@suse.de> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel/irq')
-rw-r--r--kernel/irq/manage.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 69a3d7b9414c..0b23ff71b9b0 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -753,6 +753,16 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
753 if (new->flags & IRQF_ONESHOT) 753 if (new->flags & IRQF_ONESHOT)
754 desc->status |= IRQ_ONESHOT; 754 desc->status |= IRQ_ONESHOT;
755 755
756 /*
757 * Force MSI interrupts to run with interrupts
758 * disabled. The multi vector cards can cause stack
759 * overflows due to nested interrupts when enough of
760 * them are directed to a core and fire at the same
761 * time.
762 */
763 if (desc->msi_desc)
764 new->flags |= IRQF_DISABLED;
765
756 if (!(desc->status & IRQ_NOAUTOEN)) { 766 if (!(desc->status & IRQ_NOAUTOEN)) {
757 desc->depth = 0; 767 desc->depth = 0;
758 desc->status &= ~IRQ_DISABLED; 768 desc->status &= ~IRQ_DISABLED;