Skip to contentSkip to conversation

xtensa: don't use linux IRQ #0

PATCH Superseded Max Filippov 1 participant 1 message Jun 5, 2017

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Max Filippov

author maintainer
#0 lore raw

PATCH 1/1 xtensa: don't use linux IRQ #0

Linux IRQ #0 is reserved for error reporting and may not be used. Increase NR_IRQS for one additional slot and increase irq_domain_add_legacy parameter first_irq value to 1, so that linux IRQ #0 is not associated with hardware IRQ #0 in legacy IRQ domains. This fixes inability to use hardware IRQ #0 in configurations that don't use device tree.

---
 arch/xtensa/include/asm/irq.h    | 2 +-
 arch/xtensa/kernel/irq.c         | 5 -----
 drivers/irqchip/irq-xtensa-mx.c  | 2 +-
 drivers/irqchip/irq-xtensa-pic.c | 2 +-
 4 files changed, 3 insertions(+), 8 deletions(-)
arch/xtensa/include/asm/irq.h +1 -1
index f71f88e..e0a3ace 100644
@@ -29,7 +29,7 @@ static inline void variant_irq_disable(unsigned int irq) { }
 # define PLATFORM_NR_IRQS 0
 #endif
 #define XTENSA_NR_IRQS XCHAL_NUM_INTERRUPTS
-#define NR_IRQS (XTENSA_NR_IRQS + VARIANT_NR_IRQS + PLATFORM_NR_IRQS)
+#define NR_IRQS (XTENSA_NR_IRQS + VARIANT_NR_IRQS + PLATFORM_NR_IRQS + 1)
 
 #if VARIANT_NR_IRQS == 0
 static inline void variant_init_irq(void) { }
arch/xtensa/kernel/irq.c +0 -5
index a265edd..9934102 100644
@@ -34,11 +34,6 @@ asmlinkage void do_IRQ(int hwirq, struct pt_regs *regs)
 {
 	int irq = irq_find_mapping(NULL, hwirq);
 
-	if (hwirq >= NR_IRQS) {
-		printk(KERN_EMERG "%s: cannot handle IRQ %d\n",
-				__func__, hwirq);
-	}
-
 #ifdef CONFIG_DEBUG_STACKOVERFLOW
 	/* Debugging check for stack overflow: is there less than 1KB free? */
 	{
drivers/irqchip/irq-xtensa-mx.c +1 -1
index bb3ac5f..72a391e 100644
@@ -142,7 +142,7 @@ static struct irq_chip xtensa_mx_irq_chip = {
 int __init xtensa_mx_init_legacy(struct device_node *interrupt_parent)
 {
 	struct irq_domain *root_domain =
-		irq_domain_add_legacy(NULL, NR_IRQS, 0, 0,
+		irq_domain_add_legacy(NULL, NR_IRQS - 1, 1, 0,
 				&xtensa_mx_irq_domain_ops,
 				&xtensa_mx_irq_chip);
 	irq_set_default_host(root_domain);
drivers/irqchip/irq-xtensa-pic.c +1 -1
index 472ae17..f728755 100644
@@ -89,7 +89,7 @@ static struct irq_chip xtensa_irq_chip = {
 int __init xtensa_pic_init_legacy(struct device_node *interrupt_parent)
 {
 	struct irq_domain *root_domain =
-		irq_domain_add_legacy(NULL, NR_IRQS, 0, 0,
+		irq_domain_add_legacy(NULL, NR_IRQS - 1, 1, 0,
 				&xtensa_irq_domain_ops, &xtensa_irq_chip);
 	irq_set_default_host(root_domain);
 	return 0;
Signature · 1 line
2.1.4