--- /dev/null
+From 46f4f8f665080900e865392f4b3593be463bf0d8 Mon Sep 17 00:00:00 2001
+From: Ralf Baechle <ralf@linux-mips.org>
+Date: Fri, 8 Feb 2008 04:22:01 -0800
+Message-ID: <93564eb70802241736l741e7406o29fab05a611c12c7@mail.gmail.com>
+Subject: IRQ_NOPROBE helper functions
+
+Probing non-ISA interrupts using the handle_percpu_irq as their handle_irq
+method may crash the system because handle_percpu_irq does not check
+IRQ_WAITING. This for example hits the MIPS Qemu configuration.
+
+This patch provides two helper functions set_irq_noprobe and set_irq_probe to
+set rsp. clear the IRQ_NOPROBE flag. The only current caller is MIPS code
+but this really belongs into generic code.
+
+As an aside, interrupt probing these days has become a mostly obsolete if not
+dangerous art. I think Linux interrupts should be changed to default to
+non-probing but that's subject of this patch.
+
+Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
+Acked-and-tested-by: Rob Landley <rob@landley.net>
+Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
+Cc: Ingo Molnar <mingo@elte.hu>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+ include/linux/irq.h | 3 +++
+ kernel/irq/chip.c | 36 ++++++++++++++++++++++++++++++++++++
+ 2 files changed, 39 insertions(+)
+
+--- linux-2.6.24.3.orig/include/linux/irq.h
++++ linux-2.6.24.3/include/linux/irq.h
+@@ -367,6 +367,9 @@ set_irq_chained_handler(unsigned int irq
+ __set_irq_handler(irq, handle, 1, NULL);
+ }
+
++extern void set_irq_noprobe(unsigned int irq);
++extern void set_irq_probe(unsigned int irq);
++
+ /* Handle dynamic irq creation and destruction */
+ extern int create_irq(void);
+ extern void destroy_irq(unsigned int irq);
+--- linux-2.6.24.3.orig/kernel/irq/chip.c
++++ linux-2.6.24.3/kernel/irq/chip.c
+@@ -607,3 +607,39 @@ set_irq_chip_and_handler_name(unsigned i
+ set_irq_chip(irq, chip);
+ __set_irq_handler(irq, handle, 0, name);
+ }
++
++void __init set_irq_noprobe(unsigned int irq)
++{
++ struct irq_desc *desc;
++ unsigned long flags;
++
++ if (irq >= NR_IRQS) {
++ printk(KERN_ERR "Trying to mark IRQ%d non-probeable\n", irq);
++
++ return;
++ }
++
++ desc = irq_desc + irq;
++
++ spin_lock_irqsave(&desc->lock, flags);
++ desc->status |= IRQ_NOPROBE;
++ spin_unlock_irqrestore(&desc->lock, flags);
++}
++
++void __init set_irq_probe(unsigned int irq)
++{
++ struct irq_desc *desc;
++ unsigned long flags;
++
++ if (irq >= NR_IRQS) {
++ printk(KERN_ERR "Trying to mark IRQ%d probeable\n", irq);
++
++ return;
++ }
++
++ desc = irq_desc + irq;
++
++ spin_lock_irqsave(&desc->lock, flags);
++ desc->status &= ~IRQ_NOPROBE;
++ spin_unlock_irqrestore(&desc->lock, flags);
++}
--- /dev/null
+From 24649c00ca334955ac7d8a79f5a7834fc7ea441d Mon Sep 17 00:00:00 2001
+From: Ralf Baechle <ralf@linux-mips.org>
+Date: Fri, 8 Feb 2008 04:22:02 -0800
+Message-ID: <93564eb70802241736l741e7406o29fab05a611c12c7@mail.gmail.com>
+Subject: MIPS: Mark all but i8259 interrupts as no-probe.
+
+Use set_irq_noprobe() to mark all MIPS interrupts as non-probe. Override that
+default for i8259 interrupts.
+
+Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
+Acked-and-tested-by: Rob Landley <rob@landley.net>
+Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
+Cc: Ingo Molnar <mingo@elte.hu>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+ arch/mips/kernel/i8259.c | 4 +++-
+ arch/mips/kernel/irq.c | 5 +++++
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+--- linux-2.6.24.3.orig/arch/mips/kernel/i8259.c
++++ linux-2.6.24.3/arch/mips/kernel/i8259.c
+@@ -338,8 +338,10 @@ void __init init_i8259_irqs(void)
+
+ init_8259A(0);
+
+- for (i = I8259A_IRQ_BASE; i < I8259A_IRQ_BASE + 16; i++)
++ for (i = I8259A_IRQ_BASE; i < I8259A_IRQ_BASE + 16; i++) {
+ set_irq_chip_and_handler(i, &i8259A_chip, handle_level_irq);
++ set_irq_probe(i);
++ }
+
+ setup_irq(I8259A_IRQ_BASE + PIC_CASCADE_IR, &irq2);
+ }
+--- linux-2.6.24.3.orig/arch/mips/kernel/irq.c
++++ linux-2.6.24.3/arch/mips/kernel/irq.c
+@@ -145,6 +145,11 @@ __setup("nokgdb", nokgdb);
+
+ void __init init_IRQ(void)
+ {
++ int i;
++
++ for (i = 0; i < NR_IRQS; i++)
++ set_irq_noprobe(i);
++
+ arch_init_irq();
+
+ #ifdef CONFIG_KGDB