Skip to content

Commit 74296a8

Browse files
author
Ingo Molnar
committed
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>
1 parent 5a2dd72 commit 74296a8

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

‎include/linux/interrupt.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,12 @@ static inline void init_irq_proc(void)
462462
}
463463
#endif
464464

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+
465471
int show_interrupts(struct seq_file *p, void *v);
466472

467473
struct irq_desc;

‎kernel/irq/spurious.c‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static int misrouted_irq(int irq)
104104
return ok;
105105
}
106106

107-
static void poll_spurious_irqs(unsigned long dummy)
107+
static void poll_all_shared_irqs(void)
108108
{
109109
struct irq_desc *desc;
110110
int i;
@@ -123,11 +123,23 @@ static void poll_spurious_irqs(unsigned long dummy)
123123

124124
try_one_irq(i, desc);
125125
}
126+
}
127+
128+
static void poll_spurious_irqs(unsigned long dummy)
129+
{
130+
poll_all_shared_irqs();
126131

127132
mod_timer(&poll_spurious_irq_timer,
128133
jiffies + POLL_SPURIOUS_IRQ_INTERVAL);
129134
}
130135

136+
#ifdef CONFIG_DEBUG_SHIRQ
137+
void debug_poll_all_shared_irqs(void)
138+
{
139+
poll_all_shared_irqs();
140+
}
141+
#endif
142+
131143
/*
132144
* If 99,900 of the previous 100,000 interrupts have not been handled
133145
* then assume that the IRQ is stuck in some manner. Drop a diagnostic

0 commit comments

Comments
 (0)