From patchwork Mon Nov 21 14:39:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 23861 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1643651wrr; Mon, 21 Nov 2022 07:07:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf78AMWxZGVelASyj+GeiXo1C9qGSDaaJOMCCuf9M9fcRcf9MOdYi0tJ7VD49gzZWxtjP9vL X-Received: by 2002:aa7:cb09:0:b0:463:ff10:4ff with SMTP id s9-20020aa7cb09000000b00463ff1004ffmr5627537edt.290.1669043278508; Mon, 21 Nov 2022 07:07:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669043278; cv=none; d=google.com; s=arc-20160816; b=z18nwBr/ZX0WZApIsOy6WjuYsLZlqNgu9oIxfmdx19oVwU4Hol7D9trqzJX9rY9gzp XEzSa60HsovpxTY1+hMFUu4skDEOcIYcOLqRNGgkZr3WHhYF6oV/dmjvHMjGLRDj30tI TfUQI9zQ8GX3+kt01w/GIaKSqJYkjqu+hPPr18HzVYctsyhtkuM4PqnqPlz6k4Hd8Kv7 XH9BZpss5O41pZSE4ynPPgYaXyRnwSlAXNROQAHAVOmML3zrBFN97Og4XUJPEkkYO5Qz DlMaLDR5HJogcvyR4hoMsZPBSk5iPB8VxFDsDz3tBFgpj25sJckVpe2gz2ssmrpY4HUZ aygA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:references:subject:cc:to:from :dkim-signature:dkim-signature:message-id; bh=WmdB2qfbbOZDzyPsz/NXt+XoJ1l6mf2vgeHiaNbEoMk=; b=E3u6JwyslyDCpAMsqaQb46dt93d4YLY7fmhbnDZHpcG8OsZg9+YBlKN/eWSmZDu8OJ fJ+2Txakf/wO5Z8Q9TWyatWp4ssa+pdHgBDN4E1Gj249RO0ZmO2gQIPG1QP+vonu1QEr fiEy1yPaD3D14LCdbXBjcSUAjAKBzOrXIQZ7F010v0v+tXUmg9nYH5ESMUOHu1bh+JU8 EP+NwYHPBQ9GZxE50iZD/dxCu8AbuJZGoMyfUXQztXikI+2mlg0eQXTSHq+li8BJ20vh n9wKgkctNY6nuGGOh8Nh8bT7OnXZ4fYg+ywYlor0jwJt3EbYTQlmRHdMzMmaAxLYDg0h OGbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=3XdDjRAf; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=4jBwfkJE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs30-20020a1709072d1e00b00780def41dc4si10497086ejc.527.2022.11.21.07.07.16; Mon, 21 Nov 2022 07:07:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=3XdDjRAf; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=4jBwfkJE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229662AbiKUOuH (ORCPT + 99 others); Mon, 21 Nov 2022 09:50:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229832AbiKUOsa (ORCPT ); Mon, 21 Nov 2022 09:48:30 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2D35D39EF; Mon, 21 Nov 2022 06:42:16 -0800 (PST) Message-ID: <20221121140049.363858787@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669041590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=WmdB2qfbbOZDzyPsz/NXt+XoJ1l6mf2vgeHiaNbEoMk=; b=3XdDjRAfvWJaoSFapB48hY3JPrLaN/Z7q4sEmU3KSFTXTFycWPRSkgiCbGNjPkuCqDf8Vn Z1AaTBpUaFzB4LKR8oIgRN20xnYFmsqV3kt2YF0VFNtPpZII5G/qYVnb1ioagvBSaYlzGP n389cx4FFDVw9vew4D6ur3DiIZi7y0fTvtNTxtdbAslCy+DFj9CcwtnsY8RcrfpLG00+6B vNQXlt+iLFj406UqJDWPuA5SMmN+W7xXOjTzF8cQ5rYVKpcnObLvPCbYolGRCWOYaq+YAs ufrdRiPyckN4LJddBGhbFnq8hy63WzypJX4hRk09L1q3ibFfNAjbUKWtPX3BVQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669041590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=WmdB2qfbbOZDzyPsz/NXt+XoJ1l6mf2vgeHiaNbEoMk=; b=4jBwfkJEKdyQ2OzLVskrhNL1aNHEnG09AdIvyb8YAtM+9AjlGulHq05MxUQ4vI0hVPu6lG rR6+bZPDs+0smpDw== From: Thomas Gleixner To: LKML Cc: Will Deacon , linux-pci@vger.kernel.org, Bjorn Helgaas , Lorenzo Pieralisi , Marc Zyngier , Greg Kroah-Hartman , Jason Gunthorpe , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Ammar Faizi , Robin Murphy , Lorenzo Pieralisi , Nishanth Menon , Tero Kristo , Santosh Shilimkar , linux-arm-kernel@lists.infradead.org, Vinod Koul , Sinan Kaya , Andy Gross , Bjorn Andersson , Mark Rutland , Shameerali Kolothum Thodi , Zenghui Yu , Shawn Guo , Sascha Hauer , Fabio Estevam Subject: [patch V2 17/40] irqchip: Convert all platform MSI users to the new API References: <20221121135653.208611233@linutronix.de> MIME-Version: 1.0 Date: Mon, 21 Nov 2022 15:39:49 +0100 (CET) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750118724648438961?= X-GMAIL-MSGID: =?utf-8?q?1750118724648438961?= Switch all the users of the platform MSI domain over to invoke the new interfaces which branch to the original platform MSI functions when the irqdomain associated to the caller device does not yet provide MSI parent functionality. No functional change. Signed-off-by: Thomas Gleixner Cc: Vinod Koul Cc: Sinan Kaya Cc: Andy Gross Cc: Bjorn Andersson Cc: Mark Rutland --- drivers/dma/mv_xor_v2.c | 8 ++++---- drivers/dma/qcom/hidma.c | 6 +++--- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 5 +++-- drivers/mailbox/bcm-flexrm-mailbox.c | 8 ++++---- drivers/perf/arm_smmuv3_pmu.c | 4 ++-- 5 files changed, 16 insertions(+), 15 deletions(-) --- a/drivers/dma/mv_xor_v2.c +++ b/drivers/dma/mv_xor_v2.c @@ -764,8 +764,8 @@ static int mv_xor_v2_probe(struct platfo goto disable_reg_clk; } - ret = platform_msi_domain_alloc_irqs(&pdev->dev, 1, - mv_xor_v2_set_msi_msg); + ret = platform_device_ims_init_and_alloc_irqs(&pdev->dev, 1, + mv_xor_v2_set_msi_msg); if (ret) goto disable_clk; @@ -868,7 +868,7 @@ static int mv_xor_v2_probe(struct platfo xor_dev->desc_size * MV_XOR_V2_DESC_NUM, xor_dev->hw_desq_virt, xor_dev->hw_desq); free_msi_irqs: - platform_msi_domain_free_irqs(&pdev->dev); + platform_device_ims_free_irqs_all(&pdev->dev); disable_clk: clk_disable_unprepare(xor_dev->clk); disable_reg_clk: @@ -888,7 +888,7 @@ static int mv_xor_v2_remove(struct platf devm_free_irq(&pdev->dev, xor_dev->irq, xor_dev); - platform_msi_domain_free_irqs(&pdev->dev); + platform_device_ims_free_irqs_all(&pdev->dev); tasklet_kill(&xor_dev->irq_tasklet); --- a/drivers/dma/qcom/hidma.c +++ b/drivers/dma/qcom/hidma.c @@ -697,7 +697,7 @@ static void hidma_free_msis(struct hidma devm_free_irq(dev, virq, &dmadev->lldev); } - platform_msi_domain_free_irqs(dev); + platform_device_ims_free_irqs_all(dev); #endif } @@ -707,8 +707,8 @@ static int hidma_request_msi(struct hidm #ifdef CONFIG_GENERIC_MSI_IRQ int rc, i, virq; - rc = platform_msi_domain_alloc_irqs(&pdev->dev, HIDMA_MSI_INTS, - hidma_write_msi_msg); + rc = platform_device_ims_init_and_alloc_irqs(&pdev->dev, HIDMA_MSI_INTS, + hidma_write_msi_msg); if (rc) return rc; --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -3122,7 +3122,8 @@ static int arm_smmu_update_gbpa(struct a static void arm_smmu_free_msis(void *data) { struct device *dev = data; - platform_msi_domain_free_irqs(dev); + + platform_device_ims_free_irqs_all(dev); } static void arm_smmu_write_msi_msg(struct msi_desc *desc, struct msi_msg *msg) @@ -3163,7 +3164,7 @@ static void arm_smmu_setup_msis(struct a } /* Allocate MSIs for evtq, gerror and priq. Ignore cmdq */ - ret = platform_msi_domain_alloc_irqs(dev, nvec, arm_smmu_write_msi_msg); + ret = platform_device_ims_init_and_alloc_irqs(dev, nvec, arm_smmu_write_msi_msg); if (ret) { dev_warn(dev, "failed to allocate MSIs - falling back to wired irqs\n"); return; --- a/drivers/mailbox/bcm-flexrm-mailbox.c +++ b/drivers/mailbox/bcm-flexrm-mailbox.c @@ -1591,8 +1591,8 @@ static int flexrm_mbox_probe(struct plat } /* Allocate platform MSIs for each ring */ - ret = platform_msi_domain_alloc_irqs(dev, mbox->num_rings, - flexrm_mbox_msi_write); + ret = platform_device_ims_init_and_alloc_irqs(dev, mbox->num_rings, + flexrm_mbox_msi_write); if (ret) goto fail_destroy_cmpl_pool; @@ -1645,7 +1645,7 @@ static int flexrm_mbox_probe(struct plat fail_free_debugfs_root: debugfs_remove_recursive(mbox->root); - platform_msi_domain_free_irqs(dev); + platform_device_ims_free_irqs_all(dev); fail_destroy_cmpl_pool: dma_pool_destroy(mbox->cmpl_pool); fail_destroy_bd_pool: @@ -1661,7 +1661,7 @@ static int flexrm_mbox_remove(struct pla debugfs_remove_recursive(mbox->root); - platform_msi_domain_free_irqs(dev); + platform_device_ims_free_irqs_all(dev); dma_pool_destroy(mbox->cmpl_pool); dma_pool_destroy(mbox->bd_pool); --- a/drivers/perf/arm_smmuv3_pmu.c +++ b/drivers/perf/arm_smmuv3_pmu.c @@ -685,7 +685,7 @@ static void smmu_pmu_free_msis(void *dat { struct device *dev = data; - platform_msi_domain_free_irqs(dev); + platform_device_ims_free_irqs_all(dev); } static void smmu_pmu_write_msi_msg(struct msi_desc *desc, struct msi_msg *msg) @@ -715,7 +715,7 @@ static void smmu_pmu_setup_msi(struct sm if (!(readl(pmu->reg_base + SMMU_PMCG_CFGR) & SMMU_PMCG_CFGR_MSI)) return; - ret = platform_msi_domain_alloc_irqs(dev, 1, smmu_pmu_write_msi_msg); + ret = platform_device_ims_init_and_alloc_irqs(dev, 1, smmu_pmu_write_msi_msg); if (ret) { dev_warn(dev, "failed to allocate MSIs\n"); return;