From patchwork Wed Dec 4 12:45:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 13893726 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0A6A7E77174 for ; Wed, 4 Dec 2024 12:58:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7J+2XZHF+cTylrJi6VEqpHl6T8YP1my+zkG0UJ92TUw=; b=cskVpWE71y02rB8QTgw0Qo6hJk Nr9cppba784HVSDg7gPvu4unzHIUIynejWwU6PozfKLCqr2PHjgWTM95tX+3RGmfuiosy+5qByDhU lG9eiOISxwe1It3arr7vU0N1XF/uINM6Oi9dT8lDqlpCSUkX3c0H/dRBZSzyo2MHFcKMPU0TuMgYu ivIMCjo15LsSkrSTE5CmrBZepEqWJKgqHh0A6TIwqhiEPIJSjRq5T/mmNNRY/h1EWz+XqJgfi7J6K PudftA7lO0yk8jPypDubLaT6aurfdazR8xLDI1imoS/h88QzRjB3M4DAqi1boZcG/jGcUemniKUoK PSnS0naw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tIoxN-0000000CavB-1RfS; Wed, 04 Dec 2024 12:58:17 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tIolc-0000000CYRB-3Tsq; Wed, 04 Dec 2024 12:46:10 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 1F4B8A414FD; Wed, 4 Dec 2024 12:44:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA059C4CEE1; Wed, 4 Dec 2024 12:46:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733316366; bh=1V1FmvDMYnTWLajD7/gkCCe4tIOFd8A5mV3a3mgRPVM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n3iG8HnOi+ARtsWCUBL1CRJL9kMugczwqyYnB+XTeNHXx9L8y2GQ22sIoWSLtcxy6 QXIPGa+mIuBiymtO45sUfVk8J0kI5TmsKayPVHsiyrhY4M9tmzCYgno6vJsJJgfUpj u9revKLDf+dC0ACsldoFraFy3jZSqA5a20y1KsX7Wc/lJ3dsAEXpD+Lnu20YAVnyu5 9T4NwHb+gQenhY9XN1DvHJVLfUGJUkQbOcfpnLMFaXGoV1URNyDbP6vd8eXn55VWx/ 2/O3YOtPxLrX0Hwp0EmB8RWPAHQR6/6mg7t+SOeBxMApoznkpC2v9t6QEDVTQ9Nhvn KhMWJcvs1B++w== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tIolY-000RHy-Uq; Wed, 04 Dec 2024 12:46:05 +0000 From: Marc Zyngier To: iommu@lists.linux.dev, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, loongarch@lists.linux.dev, linux-riscv@lists.infradead.org, linux-pci@vger.kernel.org Cc: Joerg Roedel , Suravee Suthikulpanit , David Woodhouse , Lu Baolu , Thomas Gleixner , Shawn Guo , Sascha Hauer , Fabio Estevam , Huacai Chen , WANG Xuerui , Jiaxun Yang , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Manivannan Sadhasivam , Bjorn Helgaas , Toan Le , Alyssa Rosenzweig Subject: [PATCH 03/11] irqchip/gic: Convert to msi_create_parent_irq_domain() helper Date: Wed, 4 Dec 2024 12:45:41 +0000 Message-Id: <20241204124549.607054-4-maz@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20241204124549.607054-1-maz@kernel.org> References: <20241204124549.607054-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: iommu@lists.linux.dev, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, loongarch@lists.linux.dev, linux-riscv@lists.infradead.org, linux-pci@vger.kernel.org, joro@8bytes.org, suravee.suthikulpanit@amd.com, dwmw2@infradead.org, baolu.lu@linux.intel.com, tglx@linutronix.de, shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com, chenhuacai@kernel.org, kernel@xen0n.name, jiaxun.yang@flygoat.com, andrew@lunn.ch, gregory.clement@bootlin.com, sebastian.hesselbarth@gmail.com, anup@brainfault.org, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, lpieralisi@kernel.org, kw@linux.com, manivannan.sadhasivam@linaro.org, bhelgaas@google.com, toan@os.amperecomputing.com, alyssa@rosenzweig.io X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241204_044608_996852_BBFB5338 X-CRM114-Status: GOOD ( 13.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now that we have a concise helper to create an MSI parent domain, switch the GIC family over to that. Signed-off-by: Marc Zyngier --- drivers/irqchip/irq-gic-v2m.c | 9 ++++----- drivers/irqchip/irq-gic-v3-its.c | 14 +++++--------- drivers/irqchip/irq-gic-v3-mbi.c | 9 ++++----- 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/drivers/irqchip/irq-gic-v2m.c b/drivers/irqchip/irq-gic-v2m.c index db79ae622f3c4..4916743aed314 100644 --- a/drivers/irqchip/irq-gic-v2m.c +++ b/drivers/irqchip/irq-gic-v2m.c @@ -270,16 +270,15 @@ static __init int gicv2m_allocate_domains(struct irq_domain *parent) if (!v2m) return 0; - inner_domain = irq_domain_create_hierarchy(parent, 0, 0, v2m->fwnode, - &gicv2m_domain_ops, v2m); + inner_domain = msi_create_parent_irq_domain(v2m->fwnode, + &gicv2m_msi_parent_ops, + &gicv2m_domain_ops, + 0, 0, v2m, parent); if (!inner_domain) { 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 334fd15be1de1..6f61ee7c5d394 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -5114,20 +5114,16 @@ static int its_init_domain(struct its_node *its) info->ops = &its_msi_domain_ops; info->data = its; - inner_domain = irq_domain_create_hierarchy(its_parent, - its->msi_domain_flags, 0, - its->fwnode_handle, &its_domain_ops, - info); + inner_domain = msi_create_parent_irq_domain(its->fwnode_handle, + &gic_v3_its_msi_parent_ops, + &its_domain_ops, + its->msi_domain_flags, 0, + info, its_parent); if (!inner_domain) { 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; - return 0; } diff --git a/drivers/irqchip/irq-gic-v3-mbi.c b/drivers/irqchip/irq-gic-v3-mbi.c index 63c658375fd55..e5f532f95148d 100644 --- a/drivers/irqchip/irq-gic-v3-mbi.c +++ b/drivers/irqchip/irq-gic-v3-mbi.c @@ -211,14 +211,13 @@ static int mbi_allocate_domain(struct irq_domain *parent) { struct irq_domain *nexus_domain; - nexus_domain = irq_domain_create_hierarchy(parent, 0, 0, parent->fwnode, - &mbi_domain_ops, NULL); + nexus_domain = msi_create_parent_irq_domain(parent->fwnode, + &gic_v3_mbi_msi_parent_ops, + &mbi_domain_ops, + 0, 0, NULL, parent); 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; }