From patchwork Fri Mar 3 12:46:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cai Huoqing X-Patchwork-Id: 63882 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp390574wrd; Fri, 3 Mar 2023 04:52:59 -0800 (PST) X-Google-Smtp-Source: AK7set+hl+ITDoGnTHjKH+WWxmVdBDbUrvKoOnoY3oQ0R+auKRNQ9ICSklbd6wNprO+zPq38UWaE X-Received: by 2002:a05:6a20:1585:b0:cc:32aa:8570 with SMTP id h5-20020a056a20158500b000cc32aa8570mr2336869pzj.14.1677847979647; Fri, 03 Mar 2023 04:52:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677847979; cv=none; d=google.com; s=arc-20160816; b=oC9pI9hjPrFzKj2UUO5fG0+yRtqh0rawml3EpmEE8owNB5qGsCderRYcY1q47kw0xj RjrUjc+6q2AEnMhcd/PggM3rH1Ip3DqbR2XUj52Mgf8XqXqrjxCPR8uOXgXWLt57LgcQ cz4BT1xkuWQzCYq75HXpcHtiJ3OerRVzB5IDz9H006Yvk9qZMi/RdjCl+1G8yiDriaIU l4q8lBBSkhARQNF12xPpx2sT2j+2GjIcJhl8E3kjom+L6WnsQhP4BbB3ryW7//7K6/Jo H1RRlybTbrZDAO8Fq1oES+6gFuj6x/oA5R+TYUS1220MxKdSpnvq/wxV3D1voL9tqicO uUYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=C2Gj3Ch7hBh75WMJAHVGAr9mLSJges7Su8Qtlbft6Rc=; b=K8LbjJlvJHkSwYkyvsIWJQ78EN0UCqbSdxF8KXywc1g8NmApCz6vbPFarqiph/PukY gM1ybrdj078oNTDwnfeC8GCQombDmJi5VtLaq1p30iFbXlpdrJGfSXbNgfwBchsEChU/ 8FVQYn1WoJPKHiOzgIj3CuLPztmWtLNVX6f8Co5seyVlJnAhEVxfycmyYUma2wwKFU+S dO/t8EUhnm2GFUg+4/HSplIhNs8PpSXivghtk95lhMWZmjPfUuCwlQhMZ/k2KLKM/Wk4 drvGSedUKI48uTC9FKsEqEE8DQzLTyYPRu8serht/MU5k3YkdeIkgaEOTSOlzkHAyuFX Ac3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="JZ/QDOVn"; 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=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a19-20020aa79713000000b0059338de4684si2204526pfg.255.2023.03.03.04.52.46; Fri, 03 Mar 2023 04:52:59 -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=@linux.dev header.s=key1 header.b="JZ/QDOVn"; 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=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229974AbjCCMrG (ORCPT + 99 others); Fri, 3 Mar 2023 07:47:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230217AbjCCMrA (ORCPT ); Fri, 3 Mar 2023 07:47:00 -0500 Received: from out-29.mta1.migadu.com (out-29.mta1.migadu.com [IPv6:2001:41d0:203:375::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE06662319 for ; Fri, 3 Mar 2023 04:46:58 -0800 (PST) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1677847616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C2Gj3Ch7hBh75WMJAHVGAr9mLSJges7Su8Qtlbft6Rc=; b=JZ/QDOVn/y7Dp8KWmS+wluD+FTnS5F8Dmyt5PVAwZmwqSdcKUrR0WVwk0aNMgcKGgFLILJ rDoeEoULMBh2AqpKS5UAG0R+8fsmRmI1UkmeRbuOc8BuGJDCuu3nL1pyneIcxq48W0Fpzf j4jbRUvAsdCA8TlCbcX6MNN3yb8luNE= From: Cai Huoqing To: fancer.lancer@gmail.com Cc: Cai huoqing , Gustavo Pimentel , Vinod Koul , Jingoo Han , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v5 1/4] dmaengine: dw-edma: Rename dw_edma_core_ops structure to dw_edma_plat_ops Date: Fri, 3 Mar 2023 20:46:31 +0800 Message-Id: <20230303124642.5519-2-cai.huoqing@linux.dev> In-Reply-To: <20230303124642.5519-1-cai.huoqing@linux.dev> References: <20230303124642.5519-1-cai.huoqing@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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?1759351123027538814?= X-GMAIL-MSGID: =?utf-8?q?1759351123027538814?= From: Cai huoqing Rename dw_edma_core_ops structure to dw_edma_plat_ops, the ops is platform specific operations: the DMA device environment configs like IRQs, address translation, etc. The dw_edma_plat_ops name was supposed to refer to the platform which the DW eDMA engine is embedded to, like PCIe end-point (accessible via the PCIe bus) or a PCIe root port (directly accessible by CPU). Needless to say that for them the IRQ-vector and PCI-addresses are differently determined. The suggested name has a connection with the kernel platform device only as a private case of the eDMA/hDMA embedded into the DW PCI Root ports, though basically it was supposed to refer to any platform in which the DMA hardware lives. Anyway the renaming was necessary to distinguish two types of the implementation callbacks: 1. DW eDMA/hDMA IP-core specific operations: device-specific CSR setups in one or another aspect of the DMA-engine initialization. 2. DW eDMA/hDMA platform specific operations: the DMA device environment configs like IRQs, address translation, etc. dw_edma_core_ops is supposed to be used for the case 1, and dw_edma_plat_ops - for the case 2. Signed-off-by: Cai huoqing --- v4->v5: 1.Revert the instance dw_edma_pcie_core_ops 2.Move the change EDMA_MF_HDMA_NATIVE to patch[3/4] v4 link: https://lore.kernel.org/lkml/20230221034656.14476-2-cai.huoqing@linux.dev/ drivers/dma/dw-edma/dw-edma-pcie.c | 2 +- drivers/pci/controller/dwc/pcie-designware.c | 2 +- include/linux/dma/edma.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/dma/dw-edma/dw-edma-pcie.c b/drivers/dma/dw-edma/dw-edma-pcie.c index 2b40f2b44f5e..190b32d8016d 100644 --- a/drivers/dma/dw-edma/dw-edma-pcie.c +++ b/drivers/dma/dw-edma/dw-edma-pcie.c @@ -109,7 +109,7 @@ static u64 dw_edma_pcie_address(struct device *dev, phys_addr_t cpu_addr) return region.start; } -static const struct dw_edma_core_ops dw_edma_pcie_core_ops = { +static const struct dw_edma_plat_ops dw_edma_pcie_core_ops = { .irq_vector = dw_edma_pcie_irq_vector, .pci_address = dw_edma_pcie_address, }; diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c index 53a16b8b6ac2..44e90b71d429 100644 --- a/drivers/pci/controller/dwc/pcie-designware.c +++ b/drivers/pci/controller/dwc/pcie-designware.c @@ -828,7 +828,7 @@ static int dw_pcie_edma_irq_vector(struct device *dev, unsigned int nr) return platform_get_irq_byname_optional(pdev, name); } -static struct dw_edma_core_ops dw_pcie_edma_ops = { +static struct dw_edma_plat_ops dw_pcie_edma_ops = { .irq_vector = dw_pcie_edma_irq_vector, }; diff --git a/include/linux/dma/edma.h b/include/linux/dma/edma.h index d2638d9259dc..ed401c965a87 100644 --- a/include/linux/dma/edma.h +++ b/include/linux/dma/edma.h @@ -40,7 +40,7 @@ struct dw_edma_region { * iATU windows. That will be done by the controller * automatically. */ -struct dw_edma_core_ops { +struct dw_edma_plat_ops { int (*irq_vector)(struct device *dev, unsigned int nr); u64 (*pci_address)(struct device *dev, phys_addr_t cpu_addr); }; @@ -80,7 +80,7 @@ enum dw_edma_chip_flags { struct dw_edma_chip { struct device *dev; int nr_irqs; - const struct dw_edma_core_ops *ops; + const struct dw_edma_plat_ops *ops; u32 flags; void __iomem *reg_base;