diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-09-15 01:53:50 -0700 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-16 16:53:10 +0200 |
commit | e00585bb7fc3d0b601181b765a254df7ff4ea59b (patch) | |
tree | 731d07071f04f54fbf4269912524455e54002858 /kernel/irq | |
parent | 56ffa1a028b9fce3860a247c6fe79fce7cbf425b (diff) | |
download | linux-stable-e00585bb7fc3d0b601181b765a254df7ff4ea59b.tar.gz linux-stable-e00585bb7fc3d0b601181b765a254df7ff4ea59b.tar.bz2 linux-stable-e00585bb7fc3d0b601181b765a254df7ff4ea59b.zip |
irq: fix irqpoll && sparseirq
Steven Noonan reported a boot hang when using irqpoll and
CONFIG_HAVE_SPARSE_IRQ=y.
The irqpoll loop needs to be updated to not iterate from 1 to nr_irqs
but to iterate via for_each_irq_desc(). (in the former case desc can
be NULL which crashes the box)
Reported-by: Steven Noonan <steven@uplinklabs.net>
Tested-by: Steven Noonan <steven@uplinklabs.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/irq')
-rw-r--r-- | kernel/irq/spurious.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c index b5d906002e1d..ec5a4bef3054 100644 --- a/kernel/irq/spurious.c +++ b/kernel/irq/spurious.c @@ -90,14 +90,15 @@ static int misrouted_irq(int irq) { int i; int ok = 0; + struct irq_desc *desc; - for (i = 1; i < nr_irqs; i++) { - struct irq_desc *desc; + for_each_irq_desc(i, desc) { + if (!i) + continue; if (i == irq) /* Already tried */ continue; - desc = irq_to_desc(i); if (try_one_irq(i, desc)) ok = 1; } @@ -108,10 +109,14 @@ static int misrouted_irq(int irq) static void poll_spurious_irqs(unsigned long dummy) { int i; - for (i = 1; i < nr_irqs; i++) { - struct irq_desc *desc = irq_to_desc(i); + struct irq_desc *desc; + + for_each_irq_desc(i, desc) { unsigned int status; + if (!i) + continue; + /* Racy but it doesn't matter */ status = desc->status; barrier(); @@ -278,7 +283,7 @@ static int __init irqfixup_setup(char *str) __setup("irqfixup", irqfixup_setup); module_param(irqfixup, int, 0644); -MODULE_PARM_DESC("irqfixup", "0: No fixup, 1: irqfixup mode 2: irqpoll mode"); +MODULE_PARM_DESC("irqfixup", "0: No fixup, 1: irqfixup mode, 2: irqpoll mode"); static int __init irqpoll_setup(char *str) { |