Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: rrichter@cavium.com (Robert Richter)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 5/8] irqchip/gic-v3-its: Prevent its init ordering dependencies
Date: Tue,  8 Aug 2017 14:22:55 +0200	[thread overview]
Message-ID: <20170808122259.6299-6-rrichter@cavium.com> (raw)
In-Reply-To: <20170808122259.6299-1-rrichter@cavium.com>

Right now its_init() must be called before pci and platform init.
Remove ordering dependencies to allow all initialization functions
being called with the same initcall type.

Signed-off-by: Robert Richter <rrichter@cavium.com>
---
 drivers/irqchip/irq-gic-v3-its-pci-msi.c      | 4 +++-
 drivers/irqchip/irq-gic-v3-its-platform-msi.c | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-gic-v3-its-pci-msi.c b/drivers/irqchip/irq-gic-v3-its-pci-msi.c
index 5940fdf0036e..7a8fbb74f2eb 100644
--- a/drivers/irqchip/irq-gic-v3-its-pci-msi.c
+++ b/drivers/irqchip/irq-gic-v3-its-pci-msi.c
@@ -72,6 +72,8 @@ static int its_pci_msi_prepare(struct irq_domain *domain, struct device *dev,
 		return -EINVAL;
 
 	msi_info = msi_get_domain_info(domain->parent);
+	if (!msi_info)
+		return -ENODEV;
 
 	pdev = to_pci_dev(dev);
 	/*
@@ -112,7 +114,7 @@ static int __init its_pci_msi_init_one(struct fwnode_handle *handle,
 	struct irq_domain *parent;
 
 	parent = irq_find_matching_fwnode(handle, DOMAIN_BUS_NEXUS);
-	if (!parent || !msi_get_domain_info(parent)) {
+	if (!parent) {
 		pr_err("%s: Unable to locate ITS domain\n", name);
 		return -ENXIO;
 	}
diff --git a/drivers/irqchip/irq-gic-v3-its-platform-msi.c b/drivers/irqchip/irq-gic-v3-its-platform-msi.c
index 6ebc871ac63f..999d3bdc17a6 100644
--- a/drivers/irqchip/irq-gic-v3-its-platform-msi.c
+++ b/drivers/irqchip/irq-gic-v3-its-platform-msi.c
@@ -61,6 +61,8 @@ static int its_pmsi_prepare(struct irq_domain *domain, struct device *dev,
 	int ret;
 
 	msi_info = msi_get_domain_info(domain->parent);
+	if (!msi_info)
+		return -ENODEV;
 
 	if (dev->of_node)
 		ret = of_pmsi_get_dev_id(domain, dev, &dev_id);
@@ -97,7 +99,7 @@ static int __init its_pmsi_init_one(struct fwnode_handle *fwnode,
 	struct irq_domain *parent;
 
 	parent = irq_find_matching_fwnode(fwnode, DOMAIN_BUS_NEXUS);
-	if (!parent || !msi_get_domain_info(parent)) {
+	if (!parent) {
 		pr_err("%s: unable to locate ITS domain\n", name);
 		return -ENXIO;
 	}
-- 
2.11.0

  parent reply	other threads:[~2017-08-08 12:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-08 12:22 [PATCH v3 0/8] irqchip/gic-v3-its: Implement ITS nodes as kernel devices and use CMA Robert Richter
2017-08-08 12:22 ` [PATCH v3 1/8] irqchip/gic-v3-its: Initialize its nodes in probe order Robert Richter
2017-08-08 12:22 ` [PATCH v3 2/8] irqchip/gic-v3-its: Initialize MSIs with subsys_initcalls Robert Richter
2017-08-19 11:10   ` Marc Zyngier
2017-08-08 12:22 ` [PATCH v3 3/8] irqchip/gic-v3-its: Split probing from its node initialization Robert Richter
2017-08-08 12:22 ` [PATCH v3 4/8] irqchip/gic-v3-its: Decouple its initialization from gic Robert Richter
2017-08-08 12:22 ` Robert Richter [this message]
2017-08-08 12:22 ` [PATCH v3 6/8] irqchip/gic-v3-its: Initialize its nodes later Robert Richter
2017-08-21  8:30   ` Marc Zyngier
2017-08-22 13:07     ` Robert Richter
2017-08-08 12:22 ` [PATCH v3 7/8] irqchip/gic-v3-its: Handle its nodes as kernel devices Robert Richter
2017-08-08 12:22 ` [PATCH v3 8/8] irqchip, gicv3-its, cma: Use CMA for allocation of large device tables Robert Richter
2017-08-16 19:53 ` [PATCH v3 0/8] irqchip/gic-v3-its: Implement ITS nodes as kernel devices and use CMA Robert Richter

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=20170808122259.6299-6-rrichter@cavium.com \
    --to=rrichter@cavium.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox