From patchwork Wed Dec 4 12:45:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 13893727 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 5B752E7716B for ; Wed, 4 Dec 2024 12:58:31 +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=N0yQ4SES0UeXrRVh46g5WO/n7xzm6NTj5XgBDEqDyc0=; b=qhKF+fThIx451lRCX4TAkvgUZf VrIDCzV/SF1QGtc+Gdh/KonSZJ/QqcJG/a97TXDuq9ijjUKiauMfzQl4903acC0H13evuqrpiaLE9 GQkZcxXZuosRqgP49CC9+jvCAjAbMILVnh8WhExDMSyT3Kjj/NvDPRgK4Zl+d5f4ceCcD4EObsVOC nHUVM44rUGovn2J4laVUblxoFy80pHhv+b+c6a4K8xtVPWDQLJOwonTyuWEfHUvKiT5/8ZPzX2iUY pCbULA/GHDClTIFr70UrUI6r/TSu8tmUwxhHPpxR/0vagBrdPhHhDzjXH5oP2z9CWEH+A0rgNDFRA BmSdzasg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tIoxN-0000000Cavg-3u47; Wed, 04 Dec 2024 12:58:17 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tIolc-0000000CYRQ-3SK7; Wed, 04 Dec 2024 12:46:10 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 1E93E5C6E30; Wed, 4 Dec 2024 12:45:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47D82C4AF0E; Wed, 4 Dec 2024 12:46:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733316367; bh=cMEyrhut2oPOzp4WCdsADd6Mhl4M3N9+iIzR7Vo4fus=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d7gJeuaANLlfILMnAH0xfcFXpharXfkDKqBCeIrQPfX5u+LfRez7d2wcyvxDZeEju NBebxjvJDBKpWoj/KFquYuXVSv7J6GOJWuTw7921VMgO+XDikjIsWLk8Wh5LjAM5xl +7YSN6trmPfmtrNcjg1yQT0at4g11nZEx6VOJikdElShAWglpzcAWNQcvg16pqsnAe xBYvV+unmzueB+5j0TeOMcu7wMyRbIPN37UOpU3Rhlgz4YDbb5z/JElCmwS3hMABF3 sOWXIaaZV/Ocpde/D3Cln9jWVW0Xn5TknjP/RCQ+kGMDKTU/yo+tApvxbeH/8NUeI+ 7i1zPiuWCJNTw== 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 1tIolZ-000RHy-Aj; 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 04/11] irqchip/mvebu: Convert to msi_create_parent_irq_domain() helper Date: Wed, 4 Dec 2024 12:45:42 +0000 Message-Id: <20241204124549.607054-5-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_942697_011B205A X-CRM114-Status: GOOD ( 14.05 ) 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 mvebu family of interrupt controllers over to that. Signed-off-by: Marc Zyngier --- drivers/irqchip/irq-mvebu-gicp.c | 12 +++++------- drivers/irqchip/irq-mvebu-odmi.c | 13 +++++-------- drivers/irqchip/irq-mvebu-sei.c | 14 +++++--------- 3 files changed, 15 insertions(+), 24 deletions(-) diff --git a/drivers/irqchip/irq-mvebu-gicp.c b/drivers/irqchip/irq-mvebu-gicp.c index b206b7fe03f17..783bfc83c2607 100644 --- a/drivers/irqchip/irq-mvebu-gicp.c +++ b/drivers/irqchip/irq-mvebu-gicp.c @@ -229,16 +229,14 @@ static int mvebu_gicp_probe(struct platform_device *pdev) return -ENODEV; } - inner_domain = irq_domain_create_hierarchy(parent_domain, 0, - gicp->spi_cnt, - of_node_to_fwnode(node), - &gicp_domain_ops, gicp); + inner_domain = msi_create_parent_irq_domain(of_node_to_fwnode(node), + &gicp_msi_parent_ops, + &gicp_domain_ops, + 0, gicp->spi_cnt, gicp, + parent_domain); if (!inner_domain) return -ENOMEM; - irq_domain_update_bus_token(inner_domain, DOMAIN_BUS_GENERIC_MSI); - inner_domain->flags |= IRQ_DOMAIN_FLAG_MSI_PARENT; - inner_domain->msi_parent_ops = &gicp_msi_parent_ops; return 0; } diff --git a/drivers/irqchip/irq-mvebu-odmi.c b/drivers/irqchip/irq-mvebu-odmi.c index 0ba39fbdb451f..74308b1cc01f1 100644 --- a/drivers/irqchip/irq-mvebu-odmi.c +++ b/drivers/irqchip/irq-mvebu-odmi.c @@ -204,19 +204,16 @@ static int __init mvebu_odmi_init(struct device_node *node, parent_domain = irq_find_host(parent); - inner_domain = irq_domain_create_hierarchy(parent_domain, 0, - odmis_count * NODMIS_PER_FRAME, - of_node_to_fwnode(node), - &odmi_domain_ops, NULL); + inner_domain = msi_create_parent_irq_domain(of_node_to_fwnode(node), + &odmi_msi_parent_ops, + &odmi_domain_ops, 0, + odmis_count * NODMIS_PER_FRAME, + NULL, parent_domain); if (!inner_domain) { ret = -ENOMEM; goto err_unmap; } - irq_domain_update_bus_token(inner_domain, DOMAIN_BUS_GENERIC_MSI); - inner_domain->flags |= IRQ_DOMAIN_FLAG_MSI_PARENT; - inner_domain->msi_parent_ops = &odmi_msi_parent_ops; - return 0; err_unmap: diff --git a/drivers/irqchip/irq-mvebu-sei.c b/drivers/irqchip/irq-mvebu-sei.c index c12e650ae7c92..26e1a436af2d1 100644 --- a/drivers/irqchip/irq-mvebu-sei.c +++ b/drivers/irqchip/irq-mvebu-sei.c @@ -429,21 +429,17 @@ static int mvebu_sei_probe(struct platform_device *pdev) irq_domain_update_bus_token(sei->ap_domain, DOMAIN_BUS_WIRED); /* Create the 'MSI' domain */ - sei->cp_domain = irq_domain_create_hierarchy(sei->sei_domain, 0, - sei->caps->cp_range.size, - of_node_to_fwnode(node), - &mvebu_sei_cp_domain_ops, - sei); + sei->cp_domain = msi_create_parent_irq_domain(of_node_to_fwnode(node), + &sei_msi_parent_ops, + &mvebu_sei_cp_domain_ops, + 0, sei->caps->cp_range.size, + sei, sei->sei_domain); if (!sei->cp_domain) { pr_err("Failed to create CPs IRQ domain\n"); ret = -ENOMEM; goto remove_ap_domain; } - irq_domain_update_bus_token(sei->cp_domain, DOMAIN_BUS_GENERIC_MSI); - sei->cp_domain->flags |= IRQ_DOMAIN_FLAG_MSI_PARENT; - sei->cp_domain->msi_parent_ops = &sei_msi_parent_ops; - mvebu_sei_reset(sei); irq_set_chained_handler_and_data(parent_irq, mvebu_sei_handle_cascade_irq, sei);