All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Burton <paul.burton@imgtec.com>
To: <linux-mips@linux-mips.org>, Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Burton <paul.burton@imgtec.com>,
	Marc Zyngier <marc.zyngier@arm.com>,
	Jason Cooper <jason@lakedaemon.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH 01/12] irqchip: i8259: Add domain before mapping parent irq
Date: Fri, 2 Sep 2016 16:48:47 +0100	[thread overview]
Message-ID: <20160902154859.24269-2-paul.burton@imgtec.com> (raw)
In-Reply-To: <20160902154859.24269-1-paul.burton@imgtec.com>

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

 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

WARNING: multiple messages have this Message-ID (diff)
From: Paul Burton <paul.burton@imgtec.com>
To: linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Burton <paul.burton@imgtec.com>,
	Marc Zyngier <marc.zyngier@arm.com>,
	Jason Cooper <jason@lakedaemon.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 01/12] irqchip: i8259: Add domain before mapping parent irq
Date: Fri, 2 Sep 2016 16:48:47 +0100	[thread overview]
Message-ID: <20160902154859.24269-2-paul.burton@imgtec.com> (raw)
Message-ID: <20160902154847.BBInSx_d7P40ZURlhnzabYwCszy4cjpS4yzByAIhnGg@z> (raw)
In-Reply-To: <20160902154859.24269-1-paul.burton@imgtec.com>

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

 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

  reply	other threads:[~2016-09-02 15:50 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-02 15:48 [PATCH 00/12] Partial MIPS Malta DT conversion Paul Burton
2016-09-02 15:48 ` Paul Burton
2016-09-02 15:48 ` Paul Burton
2016-09-02 15:48 ` Paul Burton [this message]
2016-09-02 15:48   ` [PATCH 01/12] irqchip: i8259: Add domain before mapping parent irq Paul Burton
2016-09-02 15:48 ` [PATCH 02/12] irqchip: i8259: Allow platforms to override poll function Paul Burton
2016-09-02 15:48   ` Paul Burton
2016-09-02 15:48 ` [PATCH 03/12] irqchip: i8259: Remove unused i8259A_irq_pending Paul Burton
2016-09-02 15:48   ` Paul Burton
2016-09-02 15:48 ` [PATCH 04/12] MIPS: Malta: Allow PCI devices DMA to lower 2GB physical Paul Burton
2016-09-02 15:48   ` Paul Burton
2016-09-02 15:48 ` [PATCH 05/12] MIPS: Malta: Use all available DDR by default Paul Burton
2016-09-02 15:48   ` Paul Burton
2016-09-03 10:27   ` kbuild test robot
2016-09-03 10:27     ` kbuild test robot
2016-09-02 15:48 ` [PATCH 06/12] MIPS: Malta: Probe interrupt controllers via DT Paul Burton
2016-09-02 15:48   ` Paul Burton
2016-09-02 15:48 ` [PATCH 07/12] MIPS: Malta: Probe RTC " Paul Burton
2016-09-02 15:48   ` Paul Burton
2016-09-03 12:15   ` Sergei Shtylyov
2016-09-02 15:48 ` [PATCH 08/12] MIPS: Malta: Probe pflash " Paul Burton
2016-09-02 15:48   ` Paul Burton
2016-09-02 15:48 ` [PATCH 09/12] MIPS: Malta: Use syscon-reboot driver to reboot Paul Burton
2016-09-02 15:48   ` Paul Burton
2016-09-02 15:48 ` [PATCH 10/12] MIPS: Malta: Remove custom halt implementation Paul Burton
2016-09-02 15:48   ` Paul Burton
2016-09-02 15:48 ` [PATCH 11/12] power: reset: Add Intel PIIX4 poweroff driver Paul Burton
2016-09-02 15:48   ` Paul Burton
2016-09-02 16:26   ` Sebastian Reichel
2016-09-02 15:48 ` [PATCH 12/12] MIPS: Malta: Use PIIX4 poweroff driver to power down Paul Burton
2016-09-02 15:48   ` Paul Burton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160902154859.24269-2-paul.burton@imgtec.com \
    --to=paul.burton@imgtec.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=marc.zyngier@arm.com \
    --cc=ralf@linux-mips.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.