[PATCH v2] genirq: better error messages for spurious IRQs

From: Edward Donovan
Date: Sun Jan 01 2012 - 17:46:08 EST


We have more information than we've been giving the user, when an
IRQ goes unhandled. Working with bug reports, I've seen plenty
of users asking why the kernel is suggesting 'irqpoll' when
they're already using it. So, when an IRQ is disabled, this
patch just checks whether 'irqfixup' or 'irqpoll' were called,
and has three versions of the error message, accordingly:

- 'irqfixup' eats less resources, and the docs recommend trying
it first. Now the code does the same.

- If that does not help, recommend 'irqpoll'.

- If 'irqpoll' has not helped, most likely the firmware is too
broken; say so. Won't try to list every alternative case here.

(For clarity's sake, I'd prefer to change "nobody cared" to "not
handled", but I wouldn't want to cut the tie to archived
discussions. So I left the former, in parentheses, once. Not
sure just what's best.)

Signed-off-by: Edward Donovan <edward.donovan@xxxxxxxxxx>
---
kernel/irq/spurious.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c
index dc813a9..bd2159e 100644
--- a/kernel/irq/spurious.c
+++ b/kernel/irq/spurious.c
@@ -194,9 +194,18 @@ __report_bad_irq(unsigned int irq, struct irq_desc *desc,
if (bad_action_ret(action_ret)) {
printk(KERN_ERR "irq event %d: bogus return value %x\n",
irq, action_ret);
+ } else if (irqfixup == 1) {
+ printk(KERN_ERR "irq %d not handled, even with \"irqfixup\": "
+ "try booting with the \"irqpoll\" option.\n",
+ irq);
+ } else if (irqfixup == 2) {
+ printk(KERN_ERR "irq %d not handled, even with \"irqpoll\": "
+ "most likely the firwmare is too broken.\n",
+ irq);
} else {
- printk(KERN_ERR "irq %d: nobody cared (try booting with "
- "the \"irqpoll\" option)\n", irq);
+ printk(KERN_ERR "irq %d not handled (nobody cared): try "
+ "booting with the \"irqfixup\" option.\n",
+ irq);
}
dump_stack();
printk(KERN_ERR "handlers:\n");
--
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/