summaryrefslogtreecommitdiffstats
path: root/drivers/irqchip
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@imgtec.com>2016-09-19 17:21:18 -0400
committerRalf Baechle <ralf@linux-mips.org>2016-10-06 11:30:59 -0400
commit690803acca14e8aa101ca5204f0a23c24d7ad8c3 (patch)
treef675196c7e4af241cac7f7eccbf174f932a27cd5 /drivers/irqchip
parente6a54ba304b15275884b029c2234ea74c4e591d0 (diff)
irqchip: i8259: Add domain before mapping parent irq
Mapping the parent IRQ will use a virq number which may conflict with the hardcoded I8259A_IRQ_BASE..I8259A_IRQ_BASE+15 range that the i8259 driver expects to be free. If this occurs then we'll hit errors when adding the i8259 IRQ domain, since one of its virq numbers will already be in use. Avoid this by adding the i8259 domain before mapping the parent IRQ, such that the i8259 virq numbers become used before the parent interrupt controller gets a chance to use any of them. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Acked-by: Thomas Gleixner <tglx@linutronix.de> Cc: Marc Zyngier <marc.zyngier@arm.com> Cc: Jason Cooper <jason@lakedaemon.net> Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/14269/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'drivers/irqchip')
-rw-r--r--drivers/irqchip/irq-i8259.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/irqchip/irq-i8259.c b/drivers/irqchip/irq-i8259.c
index 6b304eb39bd2..85897fdc1527 100644
--- a/drivers/irqchip/irq-i8259.c
+++ b/drivers/irqchip/irq-i8259.c
@@ -370,13 +370,15 @@ int __init i8259_of_init(struct device_node *node, struct device_node *parent)
370 struct irq_domain *domain; 370 struct irq_domain *domain;
371 unsigned int parent_irq; 371 unsigned int parent_irq;
372 372
373 domain = __init_i8259_irqs(node);
374
373 parent_irq = irq_of_parse_and_map(node, 0); 375 parent_irq = irq_of_parse_and_map(node, 0);
374 if (!parent_irq) { 376 if (!parent_irq) {
375 pr_err("Failed to map i8259 parent IRQ\n"); 377 pr_err("Failed to map i8259 parent IRQ\n");
378 irq_domain_remove(domain);
376 return -ENODEV; 379 return -ENODEV;
377 } 380 }
378 381
379 domain = __init_i8259_irqs(node);
380 irq_set_chained_handler_and_data(parent_irq, i8259_irq_dispatch, 382 irq_set_chained_handler_and_data(parent_irq, i8259_irq_dispatch,
381 domain); 383 domain);
382 return 0; 384 return 0;