diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-01-16 11:43:50 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-16 11:46:49 -0500 |
commit | 74296a8ed6aa3c5bf672808ada690de7ba323ecc (patch) | |
tree | baf9aa0f86e27d33dff0c4d0e33774fe80c908bc | |
parent | 5a2dd72abdae75ea2960145e0549635ce4e0be96 (diff) |
irq: provide debug_poll_all_shared_irqs() method under CONFIG_DEBUG_SHIRQ
Provide a shared interrupt debug facility under CONFIG_DEBUG_SHIRQ:
it uses the existing irqpoll facilities to iterate through all
registered interrupt handlers and call those which can handle shared
IRQ lines.
This can be handy for suspend/resume debugging: if we call this function
early during resume we can trigger crashes in those drivers which have
incorrect assumptions about when exactly their ISRs will be called
during suspend/resume.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | include/linux/interrupt.h | 6 | ||||
-rw-r--r-- | kernel/irq/spurious.c | 14 |
2 files changed, 19 insertions, 1 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 9127f6b51a39..468e3a25a4a1 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -462,6 +462,12 @@ static inline void init_irq_proc(void) | |||
462 | } | 462 | } |
463 | #endif | 463 | #endif |
464 | 464 | ||
465 | #if defined(CONFIG_GENERIC_HARDIRQS) && defined(CONFIG_DEBUG_SHIRQ) | ||
466 | extern void debug_poll_all_shared_irqs(void); | ||
467 | #else | ||
468 | static inline void debug_poll_all_shared_irqs(void) { } | ||
469 | #endif | ||
470 | |||
465 | int show_interrupts(struct seq_file *p, void *v); | 471 | int show_interrupts(struct seq_file *p, void *v); |
466 | 472 | ||
467 | struct irq_desc; | 473 | struct irq_desc; |
diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c index dd364c11e56e..4d568294de3e 100644 --- a/kernel/irq/spurious.c +++ b/kernel/irq/spurious.c | |||
@@ -104,7 +104,7 @@ static int misrouted_irq(int irq) | |||
104 | return ok; | 104 | return ok; |
105 | } | 105 | } |
106 | 106 | ||
107 | static void poll_spurious_irqs(unsigned long dummy) | 107 | static void poll_all_shared_irqs(void) |
108 | { | 108 | { |
109 | struct irq_desc *desc; | 109 | struct irq_desc *desc; |
110 | int i; | 110 | int i; |
@@ -123,11 +123,23 @@ static void poll_spurious_irqs(unsigned long dummy) | |||
123 | 123 | ||
124 | try_one_irq(i, desc); | 124 | try_one_irq(i, desc); |
125 | } | 125 | } |
126 | } | ||
127 | |||
128 | static void poll_spurious_irqs(unsigned long dummy) | ||
129 | { | ||
130 | poll_all_shared_irqs(); | ||
126 | 131 | ||
127 | mod_timer(&poll_spurious_irq_timer, | 132 | mod_timer(&poll_spurious_irq_timer, |
128 | jiffies + POLL_SPURIOUS_IRQ_INTERVAL); | 133 | jiffies + POLL_SPURIOUS_IRQ_INTERVAL); |
129 | } | 134 | } |
130 | 135 | ||
136 | #ifdef CONFIG_DEBUG_SHIRQ | ||
137 | void debug_poll_all_shared_irqs(void) | ||
138 | { | ||
139 | poll_all_shared_irqs(); | ||
140 | } | ||
141 | #endif | ||
142 | |||
131 | /* | 143 | /* |
132 | * If 99,900 of the previous 100,000 interrupts have not been handled | 144 | * If 99,900 of the previous 100,000 interrupts have not been handled |
133 | * then assume that the IRQ is stuck in some manner. Drop a diagnostic | 145 | * then assume that the IRQ is stuck in some manner. Drop a diagnostic |