Skip to contentSkip to conversation

asm-generic: Raise default NR_IRQS when using sparse IRQs

PATCH In review Mark Brown 2 participants 3 messages Nov 24, 2010 Generic include/asm header files

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 asm-generic: Raise default NR_IRQS when using sparse IRQs

Rather than have each platform using sparse IRQs pick a suitably large NR_IRQS for use with sparse IRQs make the default exceptionally high when they are enabled.

---
 include/asm-generic/irq.h |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
include/asm-generic/irq.h +5 -1
index b90ec0b..a76bea2 100644
@@ -4,11 +4,15 @@
 /*
  * NR_IRQS is the upper bound of how many interrupts can be handled
  * in the platform. It is used to size the static irq_map array,
- * so don't make it too big.
+ * so don't make it too big unless we're using sparse IRQs.
  */
 #ifndef NR_IRQS
+#ifdef CONFIG_SPARSE_IRQ
+#define NR_IRQS 0x7fffffff
+#else
 #define NR_IRQS 64
 #endif
+#endif
 
 static inline int irq_canonicalize(int irq)
 {
Signature · 1 line
1.7.1
#1 lore raw
Quoted 14 lines · Mark Brown

Rather than have each platform using sparse IRQs pick a suitably large NR_IRQS for use with sparse IRQs make the default exceptionally high when they are enabled.

---
 include/asm-generic/irq.h |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
include/asm-generic/irq.h +0 -0
index b90ec0b..a76bea2 100644

include/asm-generic/irq.h line 11

Quoted 9 lines
include/asm-generic/irq.h +3 -1
@@ -4,11 +4,15 @@
 /*
  * NR_IRQS is the upper bound of how many interrupts can be handled
  * in the platform. It is used to size the static irq_map array,
- * so don't make it too big.
+ * so don't make it too big unless we're using sparse IRQs.
  */
 #ifndef NR_IRQS
+#ifdef CONFIG_SPARSE_IRQ
+#define NR_IRQS 0x7fffffff

Resulting in a 256 MB bitmap. I guess you did not try to boot that on some random ARM board :)

Thanks,

tglx

author
#2 lore raw
Quoted 2 lines · Thomas Gleixner

Resulting in a 256 MB bitmap. I guess you did not try to boot that on some random ARM board :)

Right, I don't actually have any platforms that support sparse IRQs. Ho hum. I guess something like 16k or 4k IRQs might be more sane.