From patchwork Wed Mar 15 01:28:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cai Huoqing X-Patchwork-Id: 69917 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2079999wrd; Tue, 14 Mar 2023 18:33:24 -0700 (PDT) X-Google-Smtp-Source: AK7set993mWMGK7F0y0wCQaJxoxlML8aXOec0iQMJXJpywZKzRxUl6rxjPkORAuwOieSmfl6dhtb X-Received: by 2002:a62:1a8a:0:b0:5a9:c1f9:dc70 with SMTP id a132-20020a621a8a000000b005a9c1f9dc70mr32417144pfa.30.1678844003735; Tue, 14 Mar 2023 18:33:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678844003; cv=none; d=google.com; s=arc-20160816; b=H+oLIs9RjPHTYaR+oizAgTWmqBjbReQOMCA1OR1KHthYrjnctP4vgP8gBIIE9rNEHc vfJtI6s3Z2dQMaJPkJuD2BJ7UdmIferijZcwfE8ZudUS8RuzTQ+tLly7spT5t5WO0U7W rwpKHPh+Tx/rCo5qI2g1y+8USlgFmWXeCoe3e8M1BEwlj0bOnblU3jblV9MT7AKJMRbt AlgA+k0ctR042Tpx7rooTPEZAsnlwsQVeOzGSA4NiT32aoMrYI6DVmDl5wH0o/AFHrB0 7JbDKH2+t8t/nCdarWC+9HLcj/kx42eX5s5TnVyY0749ysM5Jyl8OAg+k2E9HVOJ9wu0 TMZQ== 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=2HZlRp/T66nptDhEGsCLbwtjR8oAk8lIEbbZ+3dGwNU=; b=d5a2j+uf/G3s0LqYjhoA31OT7RGWotkf3K+lFdk91xAHvYDCtoNjvHBUqDEOvRY9vv 6afGa7X1U7dGN/J2KukEk8Z5sYD2/fld3xcLRIIY/cUFhGqjYvJyF5MDltWkD7BZz82U dbKA6ZFjqPn6K5WhNbSiDYdWw6xf84Aqb+X6xgye2IUzmrwiCNOWw4F6kRhPykRrILzo frtCVZ+xD2XCebxca43ByNO5Jkm5OD3eLd1eZ0jr2/ZrYGzB0nZWVugkvjs6qw7QYxSx UOKzRRU9f28d79WbiPtO3GUyfpHzd19eEiNubecEMZ4P69o/lpEUUFhbPAOZknevsf9w Mp4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=b6FUsw4X; 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 c15-20020a056a00008f00b0058e16d0b827si3532161pfj.32.2023.03.14.18.33.09; Tue, 14 Mar 2023 18:33:23 -0700 (PDT) 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=b6FUsw4X; 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 S229866AbjCOB27 (ORCPT + 99 others); Tue, 14 Mar 2023 21:28:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229784AbjCOB24 (ORCPT ); Tue, 14 Mar 2023 21:28:56 -0400 Received: from out-55.mta1.migadu.com (out-55.mta1.migadu.com [95.215.58.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FA2C19C4A for ; Tue, 14 Mar 2023 18:28:55 -0700 (PDT) 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=1678843733; 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=2HZlRp/T66nptDhEGsCLbwtjR8oAk8lIEbbZ+3dGwNU=; b=b6FUsw4X+XqaOSn5E7oqmpZWnIX/30XeYQ5sxajP8lGD7+SEGLN+wPlRmmfnq21vn8VfCD bxLnl877cLYoLOSgNDm3f/nTipSitPe4vSiTghdC8ZSrFC8x+30kc0GhMACDuTc7A9Kj/p wgrxtOWWNvbMhIoZ2W75+BB7INp6WIs= 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 v7 1/5] dmaengine: dw-edma: Rename dw_edma_core_ops structure to dw_edma_plat_ops Date: Wed, 15 Mar 2023 09:28:32 +0800 Message-Id: <20230315012840.6986-2-cai.huoqing@linux.dev> In-Reply-To: <20230315012840.6986-1-cai.huoqing@linux.dev> References: <20230315012840.6986-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, URIBL_BLOCKED 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?1760395529680302433?= X-GMAIL-MSGID: =?utf-8?q?1760395529680302433?= From: Cai huoqing The dw_edma_core_ops structure contains a set of the operations: device IRQ numbers getter, CPU/PCI address translation. Based on the functions semantics the structure name "dw_edma_plat_ops" looks more descriptive since indeed the operations are platform-specific. The "dw_edma_core_ops" name shall be used for a structure with the IP-core specific set of callbacks in order to abstract out DW eDMA and DW HDMA setups. Such structure will be added in one of the next commit in the framework of the set of changes adding the DW HDMA device support. 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. Signed-off-by: Cai huoqing Reviewed-by: Serge Semin --- v6->v7: 1.Update the commit log. v6 link: https://lore.kernel.org/lkml/20230310032342.17395-2-cai.huoqing@linux.dev/ drivers/dma/dw-edma/dw-edma-pcie.c | 4 ++-- drivers/pci/controller/dwc/pcie-designware.c | 2 +- include/linux/dma/edma.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/dma/dw-edma/dw-edma-pcie.c b/drivers/dma/dw-edma/dw-edma-pcie.c index 2b40f2b44f5e..1c6043751dc9 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_plat_ops = { .irq_vector = dw_edma_pcie_irq_vector, .pci_address = dw_edma_pcie_address, }; @@ -225,7 +225,7 @@ static int dw_edma_pcie_probe(struct pci_dev *pdev, chip->mf = vsec_data.mf; chip->nr_irqs = nr_irqs; - chip->ops = &dw_edma_pcie_core_ops; + chip->ops = &dw_edma_pcie_plat_ops; chip->ll_wr_cnt = vsec_data.wr_ch_cnt; chip->ll_rd_cnt = vsec_data.rd_ch_cnt; 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;