mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Marc Zyngier" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Marc Zyngier <maz@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: irq/msi] irqchip/gic: Convert to msi_create_parent_irq_domain() helper
Date: Fri, 16 May 2025 19:47:08 -0000	[thread overview]
Message-ID: <174742482858.406.13074364312909397450.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20250513172819.2216709-4-maz@kernel.org>

The following commit has been merged into the irq/msi branch of tip:

Commit-ID:     c6b77822347afc17623120dbc4d10c6658304622
Gitweb:        https://git.kernel.org/tip/c6b77822347afc17623120dbc4d10c6658304622
Author:        Marc Zyngier <maz@kernel.org>
AuthorDate:    Tue, 13 May 2025 18:28:13 +01:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Fri, 16 May 2025 21:32:20 +02:00

irqchip/gic: Convert to msi_create_parent_irq_domain() helper

Switch the GIC family of interrupt chip drivers over to the common helper
function to create the interrupt domains.

[ tglx: Moved the struct out of the function call argument ]

Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20250513172819.2216709-4-maz@kernel.org

---
 drivers/irqchip/irq-gic-v2m.c    | 16 ++++++++--------
 drivers/irqchip/irq-gic-v3-its.c | 22 +++++++++-------------
 drivers/irqchip/irq-gic-v3-mbi.c | 16 ++++++----------
 3 files changed, 23 insertions(+), 31 deletions(-)

diff --git a/drivers/irqchip/irq-gic-v2m.c b/drivers/irqchip/irq-gic-v2m.c
index 6267699..102f171 100644
--- a/drivers/irqchip/irq-gic-v2m.c
+++ b/drivers/irqchip/irq-gic-v2m.c
@@ -261,23 +261,23 @@ static struct msi_parent_ops gicv2m_msi_parent_ops = {
 
 static __init int gicv2m_allocate_domains(struct irq_domain *parent)
 {
-	struct irq_domain *inner_domain;
+	struct irq_domain_info info = {
+		.ops		= &gicv2m_domain_ops,
+		.parent		= parent,
+	};
 	struct v2m_data *v2m;
 
 	v2m = list_first_entry_or_null(&v2m_nodes, struct v2m_data, entry);
 	if (!v2m)
 		return 0;
 
-	inner_domain = irq_domain_create_hierarchy(parent, 0, 0, v2m->fwnode,
-						   &gicv2m_domain_ops, v2m);
-	if (!inner_domain) {
+	info.host_data = v2m;
+	info.fwnode = v2m->fwnode;
+
+	if (!msi_create_parent_irq_domain(&info, &gicv2m_msi_parent_ops)) {
 		pr_err("Failed to create GICv2m domain\n");
 		return -ENOMEM;
 	}
-
-	irq_domain_update_bus_token(inner_domain, DOMAIN_BUS_NEXUS);
-	inner_domain->flags |= IRQ_DOMAIN_FLAG_MSI_PARENT;
-	inner_domain->msi_parent_ops = &gicv2m_msi_parent_ops;
 	return 0;
 }
 
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index d651cd4..57ecf5b 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -5122,7 +5122,12 @@ out_unmap:
 
 static int its_init_domain(struct its_node *its)
 {
-	struct irq_domain *inner_domain;
+	struct irq_domain_info dom_info = {
+		.fwnode		= its->fwnode_handle,
+		.ops		= &its_domain_ops,
+		.domain_flags	= its->msi_domain_flags,
+		.parent		= its_parent,
+	};
 	struct msi_domain_info *info;
 
 	info = kzalloc(sizeof(*info), GFP_KERNEL);
@@ -5131,21 +5136,12 @@ static int its_init_domain(struct its_node *its)
 
 	info->ops = &its_msi_domain_ops;
 	info->data = its;
+	dom_info.host_data = info;
 
-	inner_domain = irq_domain_create_hierarchy(its_parent,
-						   its->msi_domain_flags, 0,
-						   its->fwnode_handle, &its_domain_ops,
-						   info);
-	if (!inner_domain) {
+	if (!msi_create_parent_irq_domain(&dom_info, &gic_v3_its_msi_parent_ops)) {
 		kfree(info);
 		return -ENOMEM;
 	}
-
-	irq_domain_update_bus_token(inner_domain, DOMAIN_BUS_NEXUS);
-
-	inner_domain->msi_parent_ops = &gic_v3_its_msi_parent_ops;
-	inner_domain->flags |= IRQ_DOMAIN_FLAG_MSI_PARENT | IRQ_DOMAIN_FLAG_MSI_IMMUTABLE;
-
 	return 0;
 }
 
@@ -5522,7 +5518,7 @@ static struct its_node __init *its_node_init(struct resource *res,
 	its->base = its_base;
 	its->phys_base = res->start;
 	its->get_msi_base = its_irq_get_msi_base;
-	its->msi_domain_flags = IRQ_DOMAIN_FLAG_ISOLATED_MSI;
+	its->msi_domain_flags = IRQ_DOMAIN_FLAG_ISOLATED_MSI | IRQ_DOMAIN_FLAG_MSI_IMMUTABLE;
 
 	its->numa_node = numa_node;
 	its->fwnode_handle = handle;
diff --git a/drivers/irqchip/irq-gic-v3-mbi.c b/drivers/irqchip/irq-gic-v3-mbi.c
index e562b57..6a4afd1 100644
--- a/drivers/irqchip/irq-gic-v3-mbi.c
+++ b/drivers/irqchip/irq-gic-v3-mbi.c
@@ -206,17 +206,13 @@ static const struct msi_parent_ops gic_v3_mbi_msi_parent_ops = {
 
 static int mbi_allocate_domain(struct irq_domain *parent)
 {
-	struct irq_domain *nexus_domain;
+	struct irq_domain_info info = {
+		.fwnode		= parent->fwnode,
+		.ops		= &mbi_domain_ops,
+		.parent		= parent,
+	};
 
-	nexus_domain = irq_domain_create_hierarchy(parent, 0, 0, parent->fwnode,
-						   &mbi_domain_ops, NULL);
-	if (!nexus_domain)
-		return -ENOMEM;
-
-	irq_domain_update_bus_token(nexus_domain, DOMAIN_BUS_NEXUS);
-	nexus_domain->flags |= IRQ_DOMAIN_FLAG_MSI_PARENT;
-	nexus_domain->msi_parent_ops = &gic_v3_mbi_msi_parent_ops;
-	return 0;
+	return msi_create_parent_irq_domain(&info, &gic_v3_mbi_msi_parent_ops) ? 0 : -ENOMEM;
 }
 
 int __init mbi_init(struct fwnode_handle *fwnode, struct irq_domain *parent)

  parent reply	other threads:[~2025-05-16 19:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-13 17:28 [PATCH v2 0/9] irqchip: MSI parent cleanup and PCI host driver conversion Marc Zyngier
2025-05-13 17:28 ` [PATCH v2 1/9] irqchip: Make irq-msi-lib.h globally available Marc Zyngier
2025-05-16 19:47   ` [tip: irq/msi] " tip-bot2 for Marc Zyngier
2025-05-13 17:28 ` [PATCH v2 2/9] genirq/msi: Add helper for creating MSI-parent irq domains Marc Zyngier
2025-05-16 19:47   ` [tip: irq/msi] " tip-bot2 for Marc Zyngier
2025-05-13 17:28 ` [PATCH v2 3/9] irqchip/gic: Convert to msi_create_parent_irq_domain() helper Marc Zyngier
2025-05-16 10:36   ` Thomas Gleixner
2025-05-16 10:47     ` Marc Zyngier
2025-05-16 10:55       ` Thomas Gleixner
2025-05-16 19:47   ` tip-bot2 for Marc Zyngier [this message]
2025-05-13 17:28 ` [PATCH v2 4/9] irqchip/mvebu: " Marc Zyngier
2025-05-16 19:47   ` [tip: irq/msi] " tip-bot2 for Marc Zyngier
2025-05-13 17:28 ` [PATCH v2 5/9] irqchip: Drop MSI_CHIP_FLAG_SET_ACK from unsuspecting MSI drivers Marc Zyngier
2025-05-14 14:27   ` [tip: irq/urgent] " tip-bot2 for Marc Zyngier
2025-05-13 17:28 ` [PATCH v2 6/9] irqchip/msi-lib: Honour the MSI_FLAG_NO_AFFINITY flag Marc Zyngier
2025-05-16 19:47   ` [tip: irq/msi] " tip-bot2 for Marc Zyngier
2025-05-13 17:28 ` [PATCH v2 7/9] PCI: apple: Convert to MSI parent infrastructure Marc Zyngier
2025-05-13 18:06   ` Alyssa Rosenzweig
2025-05-16 19:47   ` [tip: irq/msi] " tip-bot2 for Marc Zyngier
2025-05-13 17:28 ` [PATCH v2 8/9] PCI: xgene: " Marc Zyngier
2025-05-16 19:47   ` [tip: irq/msi] " tip-bot2 for Marc Zyngier
2025-05-13 17:28 ` [PATCH v2 9/9] PCI: tegra: " Marc Zyngier
2025-05-16 19:47   ` [tip: irq/msi] " tip-bot2 for Marc Zyngier

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=174742482858.406.13074364312909397450.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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

all inboxes | Powered by JetHome®