Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1178784
| From | Marc Zyngier <marc.zyngier@arm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v3 13/15] irqchip: gicv3-its: Make the PCI/MSI code standalone |
| Date | 2015-07-07 19:30 +0200 |
| Message-ID | <pJEQW-8vd-17@gated-at.bofh.it> (permalink) |
| References | <pJEHg-8rS-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
We can now lookup the base ITS domain, making it possible to
initialize the PCI/MSI code independently from the main ITS
subsystem.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
drivers/irqchip/irq-gic-v3-its-pci-msi.c | 36 +++++++++++++++++++++++++++++---
drivers/irqchip/irq-gic-v3-its.c | 14 +------------
include/linux/irqchip/arm-gic-v3.h | 3 ---
3 files changed, 34 insertions(+), 19 deletions(-)
diff --git a/drivers/irqchip/irq-gic-v3-its-pci-msi.c b/drivers/irqchip/irq-gic-v3-its-pci-msi.c
index 7614721..4de130ac 100644
--- a/drivers/irqchip/irq-gic-v3-its-pci-msi.c
+++ b/drivers/irqchip/irq-gic-v3-its-pci-msi.c
@@ -98,8 +98,38 @@ static struct msi_domain_info its_pci_msi_domain_info = {
.chip = &its_msi_irq_chip,
};
-struct irq_domain *its_pci_msi_alloc_domain(struct device_node *np,
- struct irq_domain *parent)
+static struct of_device_id its_device_id[] = {
+ { .compatible = "arm,gic-v3-its", },
+ {},
+};
+
+static int __init its_pci_msi_init(void)
{
- return pci_msi_create_irq_domain(np, &its_pci_msi_domain_info, parent);
+ struct device_node *np;
+ struct irq_domain *parent;
+
+ for (np = of_find_matching_node(NULL, its_device_id); np;
+ np = of_find_matching_node(np, its_device_id)) {
+ if (!of_property_read_bool(np, "msi-controller"))
+ continue;
+
+ parent = irq_find_matching_host(np, DOMAIN_BUS_PLATFORM_MSI);
+ if (!parent) {
+ pr_err("%s: unable to locate ITS domain\n",
+ np->full_name);
+ continue;
+ }
+
+ if (!pci_msi_create_irq_domain(np, &its_pci_msi_domain_info,
+ parent)) {
+ pr_err("%s: unable to create PCI domain\n",
+ np->full_name);
+ continue;
+ }
+
+ pr_info("PCI/MSI: %s domain created\n", np->full_name);
+ }
+
+ return 0;
}
+subsys_initcall(its_pci_msi_init);
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index c0b574e..49020da 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -60,7 +60,6 @@ struct its_collection {
struct its_node {
raw_spinlock_t lock;
struct list_head entry;
- struct irq_domain *domain;
void __iomem *base;
unsigned long phys_base;
struct its_cmd_block *cmd_base;
@@ -1316,7 +1315,7 @@ static int its_probe(struct device_node *node, struct irq_domain *parent)
struct resource res;
struct its_node *its;
void __iomem *its_base;
- struct irq_domain *inner_domain = NULL;
+ struct irq_domain *inner_domain;
u32 val;
u64 baser, tmp;
int err;
@@ -1414,12 +1413,6 @@ static int its_probe(struct device_node *node, struct irq_domain *parent)
inner_domain->parent = parent;
inner_domain->bus_token = DOMAIN_BUS_PLATFORM_MSI;
-
- its->domain = its_pci_msi_alloc_domain(node, inner_domain);
- if (!its->domain) {
- err = -ENOMEM;
- goto out_free_domains;
- }
}
spin_lock(&its_lock);
@@ -1428,11 +1421,6 @@ static int its_probe(struct device_node *node, struct irq_domain *parent)
return 0;
-out_free_domains:
- if (its->domain)
- irq_domain_remove(its->domain);
- if (inner_domain)
- irq_domain_remove(inner_domain);
out_free_tables:
its_free_tables(its);
out_free_cmd:
diff --git a/include/linux/irqchip/arm-gic-v3.h b/include/linux/irqchip/arm-gic-v3.h
index d6149ba..01caef8 100644
--- a/include/linux/irqchip/arm-gic-v3.h
+++ b/include/linux/irqchip/arm-gic-v3.h
@@ -392,9 +392,6 @@ int its_init(struct device_node *node, struct rdists *rdists,
int its_msi_prepare(struct irq_domain *domain, u32 dev_id,
int nvec, msi_alloc_info_t *info);
-struct irq_domain *its_pci_msi_alloc_domain(struct device_node *node,
- struct irq_domain *parent);
-
#endif
#endif
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v3 00/15] Introducing per-device MSI domain Marc Zyngier <marc.zyngier@arm.com> - 2015-07-07 19:20 +0200 [PATCH v3 03/15] device core: Introduce per-device MSI domain pointer Marc Zyngier <marc.zyngier@arm.com> - 2015-07-07 19:20 +0200 [PATCH v3 02/15] PCI: MSI: Register irq domain with specific token Marc Zyngier <marc.zyngier@arm.com> - 2015-07-07 19:20 +0200 [PATCH v3 08/15] platform: of: Assign MSI domain to platform device Marc Zyngier <marc.zyngier@arm.com> - 2015-07-07 19:20 +0200 [PATCH v3 04/15] PCI/MSI: Add hooks to populate the msi_domain field Marc Zyngier <marc.zyngier@arm.com> - 2015-07-07 19:20 +0200 [PATCH v3 01/15] genirq: irqdomain: Allow irq domain aliasing Marc Zyngier <marc.zyngier@arm.com> - 2015-07-07 19:20 +0200 [PATCH v3 14/15] PCI/MSI: pci-xgene-msi: Get rid of struct msi_controller Marc Zyngier <marc.zyngier@arm.com> - 2015-07-07 19:20 +0200 [PATCH v3 09/15] irqchip: gicv3-its: Split PCI/MSI code from the core ITS driver Marc Zyngier <marc.zyngier@arm.com> - 2015-07-07 19:30 +0200 [PATCH v3 11/15] irqchip: GICv2m: Get rid of struct msi_controller Marc Zyngier <marc.zyngier@arm.com> - 2015-07-07 19:30 +0200 [PATCH v3 13/15] irqchip: gicv3-its: Make the PCI/MSI code standalone Marc Zyngier <marc.zyngier@arm.com> - 2015-07-07 19:30 +0200 [PATCH v3 05/15] PCI/MSI: of: Add support for OF-provided msi_domain Marc Zyngier <marc.zyngier@arm.com> - 2015-07-07 19:30 +0200 [PATCH v3 07/15] PCI/MSI: Let pci_msi_get_domain use struct device's msi_domain Marc Zyngier <marc.zyngier@arm.com> - 2015-07-07 19:30 +0200 [PATCH v3 06/15] PCI/MSI: of: Allow msi_domain lookup using the host bridge node Marc Zyngier <marc.zyngier@arm.com> - 2015-07-07 19:30 +0200 [PATCH v3 10/15] irqchip: gicv3-its: Register irq domain with platform MSI token Marc Zyngier <marc.zyngier@arm.com> - 2015-07-07 19:30 +0200 [PATCH v3 12/15] irqchip: gicv3-its: Get rid of struct msi_controller Marc Zyngier <marc.zyngier@arm.com> - 2015-07-07 19:30 +0200
csiph-web