mirror of
https://github.com/torvalds/linux.git
synced 2024-09-22 16:03:15 +00:00
[PATCH] setup_irq(): better mismatch debugging
When we get a mismatch between handlers on the same IRQ, all we get is "IRQ handler type mismatch for IRQ n". Let's print the name of the presently-registered handler with which we got the mismatch. Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
0579e30355
commit
8b126b7753
|
@ -216,6 +216,7 @@ int setup_irq(unsigned int irq, struct irqaction *new)
|
||||||
{
|
{
|
||||||
struct irq_desc *desc = irq_desc + irq;
|
struct irq_desc *desc = irq_desc + irq;
|
||||||
struct irqaction *old, **p;
|
struct irqaction *old, **p;
|
||||||
|
const char *old_name = NULL;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int shared = 0;
|
int shared = 0;
|
||||||
|
|
||||||
|
@ -255,8 +256,10 @@ int setup_irq(unsigned int irq, struct irqaction *new)
|
||||||
* set the trigger type must match.
|
* set the trigger type must match.
|
||||||
*/
|
*/
|
||||||
if (!((old->flags & new->flags) & IRQF_SHARED) ||
|
if (!((old->flags & new->flags) & IRQF_SHARED) ||
|
||||||
((old->flags ^ new->flags) & IRQF_TRIGGER_MASK))
|
((old->flags ^ new->flags) & IRQF_TRIGGER_MASK)) {
|
||||||
|
old_name = old->name;
|
||||||
goto mismatch;
|
goto mismatch;
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_IRQ_PER_CPU)
|
#if defined(CONFIG_IRQ_PER_CPU)
|
||||||
/* All handlers must agree on per-cpuness */
|
/* All handlers must agree on per-cpuness */
|
||||||
|
@ -322,11 +325,13 @@ int setup_irq(unsigned int irq, struct irqaction *new)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
mismatch:
|
mismatch:
|
||||||
spin_unlock_irqrestore(&desc->lock, flags);
|
|
||||||
if (!(new->flags & IRQF_PROBE_SHARED)) {
|
if (!(new->flags & IRQF_PROBE_SHARED)) {
|
||||||
printk(KERN_ERR "IRQ handler type mismatch for IRQ %d\n", irq);
|
printk(KERN_ERR "IRQ handler type mismatch for IRQ %d\n", irq);
|
||||||
|
if (old_name)
|
||||||
|
printk(KERN_ERR "current handler: %s\n", old_name);
|
||||||
dump_stack();
|
dump_stack();
|
||||||
}
|
}
|
||||||
|
spin_unlock_irqrestore(&desc->lock, flags);
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user