diff options
Diffstat (limited to 'kernel/irq/irqdesc.c')
| -rw-r--r-- | kernel/irq/irqdesc.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index 282f20230e67..2039bea31bdf 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c | |||
| @@ -94,7 +94,7 @@ int nr_irqs = NR_IRQS; | |||
| 94 | EXPORT_SYMBOL_GPL(nr_irqs); | 94 | EXPORT_SYMBOL_GPL(nr_irqs); |
| 95 | 95 | ||
| 96 | static DEFINE_MUTEX(sparse_irq_lock); | 96 | static DEFINE_MUTEX(sparse_irq_lock); |
| 97 | static DECLARE_BITMAP(allocated_irqs, NR_IRQS); | 97 | static DECLARE_BITMAP(allocated_irqs, IRQ_BITMAP_BITS); |
| 98 | 98 | ||
| 99 | #ifdef CONFIG_SPARSE_IRQ | 99 | #ifdef CONFIG_SPARSE_IRQ |
| 100 | 100 | ||
| @@ -217,6 +217,15 @@ int __init early_irq_init(void) | |||
| 217 | initcnt = arch_probe_nr_irqs(); | 217 | initcnt = arch_probe_nr_irqs(); |
| 218 | printk(KERN_INFO "NR_IRQS:%d nr_irqs:%d %d\n", NR_IRQS, nr_irqs, initcnt); | 218 | printk(KERN_INFO "NR_IRQS:%d nr_irqs:%d %d\n", NR_IRQS, nr_irqs, initcnt); |
| 219 | 219 | ||
| 220 | if (WARN_ON(nr_irqs > IRQ_BITMAP_BITS)) | ||
| 221 | nr_irqs = IRQ_BITMAP_BITS; | ||
| 222 | |||
| 223 | if (WARN_ON(initcnt > IRQ_BITMAP_BITS)) | ||
| 224 | initcnt = IRQ_BITMAP_BITS; | ||
| 225 | |||
| 226 | if (initcnt > nr_irqs) | ||
| 227 | nr_irqs = initcnt; | ||
| 228 | |||
| 220 | for (i = 0; i < initcnt; i++) { | 229 | for (i = 0; i < initcnt; i++) { |
| 221 | desc = alloc_desc(i, node); | 230 | desc = alloc_desc(i, node); |
| 222 | set_bit(i, allocated_irqs); | 231 | set_bit(i, allocated_irqs); |
