Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1486879

[PATCH v2 01/14] irqchip: i8259: Add domain before mapping parent irq

From Paul Burton <paul.burton@imgtec.com>
Newsgroups linux.kernel
Subject [PATCH v2 01/14] irqchip: i8259: Add domain before mapping parent irq
Date 2016-09-19 23:30 +0200
Message-ID <sjeiu-2pw-29@gated-at.bofh.it> (permalink)
References <sjeit-2pw-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---

Changes in v2: None

 drivers/irqchip/irq-i8259.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-i8259.c b/drivers/irqchip/irq-i8259.c
index 6b304eb..85897fd 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)
 	struct irq_domain *domain;
 	unsigned int parent_irq;
 
+	domain = __init_i8259_irqs(node);
+
 	parent_irq = irq_of_parse_and_map(node, 0);
 	if (!parent_irq) {
 		pr_err("Failed to map i8259 parent IRQ\n");
+		irq_domain_remove(domain);
 		return -ENODEV;
 	}
 
-	domain = __init_i8259_irqs(node);
 	irq_set_chained_handler_and_data(parent_irq, i8259_irq_dispatch,
 					 domain);
 	return 0;
-- 
2.9.3

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 00/14] Partial MIPS Malta DT conversion Paul Burton <paul.burton@imgtec.com> - 2016-09-19 23:30 +0200
  [PATCH v2 12/14] MIPS: Malta: Remove custom halt implementation Paul Burton <paul.burton@imgtec.com> - 2016-09-19 23:30 +0200
  [PATCH v2 02/14] irqchip: i8259: Allow platforms to override poll function Paul Burton <paul.burton@imgtec.com> - 2016-09-19 23:30 +0200
  [PATCH v2 13/14] power: reset: Add Intel PIIX4 poweroff driver Paul Burton <paul.burton@imgtec.com> - 2016-09-19 23:30 +0200
    Re: [PATCH v2 13/14] power: reset: Add Intel PIIX4 poweroff driver Sebastian Reichel <sre@kernel.org> - 2016-09-20 01:50 +0200
  [PATCH v2 04/14] MIPS: Malta: Allow PCI devices DMA to lower 2GB physical Paul Burton <paul.burton@imgtec.com> - 2016-09-19 23:30 +0200
  [PATCH v2 08/14] MIPS: Malta: Remove custom DT match table Paul Burton <paul.burton@imgtec.com> - 2016-09-19 23:30 +0200
  [PATCH v2 01/14] irqchip: i8259: Add domain before mapping parent irq Paul Burton <paul.burton@imgtec.com> - 2016-09-19 23:30 +0200
  [PATCH v2 07/14] of/platform: Probe "isa" busses by default Paul Burton <paul.burton@imgtec.com> - 2016-09-19 23:30 +0200
  [PATCH v2 11/14] MIPS: Malta: Use syscon-reboot driver to reboot Paul Burton <paul.burton@imgtec.com> - 2016-09-19 23:30 +0200
  [PATCH v2 05/14] MIPS: Malta: Use all available DDR by default Paul Burton <paul.burton@imgtec.com> - 2016-09-19 23:30 +0200
  [PATCH v2 10/14] MIPS: Malta: Probe pflash via DT Paul Burton <paul.burton@imgtec.com> - 2016-09-19 23:30 +0200

csiph-web