From patchwork Tue May 17 15:19:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 12852604 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75ADDC4332F for ; Tue, 17 May 2022 15:20:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349844AbiEQPUD (ORCPT ); Tue, 17 May 2022 11:20:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349861AbiEQPUB (ORCPT ); Tue, 17 May 2022 11:20:01 -0400 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150043.outbound.protection.outlook.com [40.107.15.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E42864B856; Tue, 17 May 2022 08:19:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O72gi4qEPVCcqh46NiyEkY5VFmPVTjaB9oJnBOAn0FtXd6IdFXbQfS8vXLwvXL/LOjkUP3jH1sSOaPC+DRXgzL4yFPRXjAvHKDb04egpUmXuFd7pbI1jNqtvBeQyFH6GFmFwWQIeeyzJqtGTTQZaLjgWbkFOFnb7kcLqABG9IDcXTffczDJlB5X9IcYKry/eUIgcfRNaSiERmBv4naft1fa1k4YBt6VP2g4IIdp8bTxPgdfotQR8uc+lmGPll8ucTmlwEzuBE/ANnamqbE+5zOM1r9Yzw/e9C9KR6QJLs60kSp69iXjRlDD5AAPI5KuZg18CeaHXPNbYQ1qvPY6+Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nvCC0s6AMnUQAuAKBzF++06HQkwR1Y07FxRbcP9jh9Y=; b=N8t1/mkxn5jFPqWLl0r2bzcOdk7vQ6VYECbytCM4istG38CO2Grb8yoYQeWC+As0IX6YhuviIO+M12aezZy0yJCzisp19Nk/skfXJ840LOfaRE3eBA6Fd5po1NI0C3sDATJgamLx8zVVh56Mf2kzhprVDJs0eJZsf5Ub/E7V2CkaUoR112bT8mPdtJuPNxgasW5msbSOtLRQ6aZYJEBH7VA8Tw09DioMmcgN4giC6vk+ByohV2MxmVMDjiObLDz5CV4isAokEXNFmApILZRq5ScF34kNGOfRSk8x2ibwSHunDPdIBAEuXMc4+rlXriT0k8R27QRpLtJInLpO+DYqAg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nvCC0s6AMnUQAuAKBzF++06HQkwR1Y07FxRbcP9jh9Y=; b=SUXE2DhVUqMkfw56WaI4tPi4DdFvgvUGvbjeVDtmFICux3frSAyASu7fXRGq2peYv8+nQ9tILWKBm2RzoZgLceVu484PAVhxdPgFvgL/sC2m/XFRE9Ii1n/nk41lxp23AJA1hivJZ6nFI0M3vUJOxIhWJVVvy25mb100thxznEc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9186.eurprd04.prod.outlook.com (2603:10a6:102:232::18) by VI1PR0401MB2285.eurprd04.prod.outlook.com (2603:10a6:800:2a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.18; Tue, 17 May 2022 15:19:51 +0000 Received: from PAXPR04MB9186.eurprd04.prod.outlook.com ([fe80::adc5:45f8:fa40:1b8a]) by PAXPR04MB9186.eurprd04.prod.outlook.com ([fe80::adc5:45f8:fa40:1b8a%7]) with mapi id 15.20.5186.021; Tue, 17 May 2022 15:19:51 +0000 From: Frank Li To: gustavo.pimentel@synopsys.com, hongxing.zhu@nxp.com, l.stach@pengutronix.de, linux-imx@nxp.com, linux-pci@vger.kernel.org, dmaengine@vger.kernel.org, fancer.lancer@gmail.com, lznuaa@gmail.com, helgaas@kernel.org, kishon@ti.com Cc: vkoul@kernel.org, lorenzo.pieralisi@arm.com, robh@kernel.org, kw@linux.com, bhelgaas@google.com, manivannan.sadhasivam@linaro.org, Sergey.Semin@baikalelectronics.ru Subject: [PATCH v11 3/8] dmaengine: dw-edma: Change rg_region to reg_base in struct dw_edma_chip Date: Tue, 17 May 2022 10:19:10 -0500 Message-Id: <20220517151915.2212838-4-Frank.Li@nxp.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220517151915.2212838-1-Frank.Li@nxp.com> References: <20220517151915.2212838-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR13CA0097.namprd13.prod.outlook.com (2603:10b6:a03:2c5::12) To PAXPR04MB9186.eurprd04.prod.outlook.com (2603:10a6:102:232::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b7599504-bd4a-4817-d624-08da3818aff4 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2285:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 01AYUtx8wz11kR3StMzoXTNz/duS6F9S1Hai4NZ3DmMx9I/8LOU+SS8WIaOdd4EjUmhD3AwMuUd3IjY1XjMLeDSbAiZ12yleKlBVjqlXkFZ0LYDg3LZ9NlGFE+dr5g2JcvF3CKVl+uTBXa9Aj2gw5LygvfeV++JtQsE26l6x0IQVBV61ge5kz+e2mmzgsKuSmFX9DQ7GN9uZAz/L/ORwUh8tRC4lHoL7Bo7smDB9jvPsr02TXXhP/vStTuD5ksSOoV0g132jZ7m++qseYOOgT5qPqUM3bSr8H/x+qW8WpfR0Sa0BXL3RYY4n7uUfwKBDNIRf3anObO1YCEvHmznwrsQmfbAIc+AdLocPDr5k/69SdaZfQqQ/lFxXvDVmNGFFdkZQSZ/fDbatGgkKAPpeGgRanDFsnwLqFzj2lgLf13kBqF6JfA1RTjp9+QOoJeDAdTZcZBmuslyCfv5L7/oMs5xx0ho4OWL+sam7WauwVnUiksMHRuYm0GQPHFwtdV1+bnv6uAXM+jE5JB63iX+f6cmtD9Wxr4DevW//4l5eJzBc7GYYJJvy5I+gaZzF6aXAO/qWg0dbqWcPXZ+yD+oeL4ciSxXCieeWeQoihMBISdGDPIFYM+oEMKE0QkGw1VMq2ikgo412dy2ppsXBV1d57ZY+CRZPDpD2BHDB1Eue50+5lR7OXs1Zl+wzTCdpgcExPmOnCc+L/dlbEt6AmoYXh0DSGGK9Cb6+MIjEqwo5sG8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9186.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(66946007)(6666004)(52116002)(8676002)(6506007)(66556008)(86362001)(36756003)(6486002)(316002)(508600001)(38350700002)(38100700002)(2616005)(1076003)(186003)(921005)(83380400001)(8936002)(2906002)(6512007)(66476007)(26005)(5660300002)(4326008)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZE/IaRiPQ2phhvqqt3LR3tDwnW4KGaZQgzyV/Phx61C3HpnjhorpnTM+6GfxNBV+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sAt71bXoU2e8L8y4jxVY+4N8BuTW6itHqQGGJXmU4VA65baE5GmjFI8YOHIYljA0kgJawqfd6lV9U6lJ22k3V1wllQ3VndX9rX58nYJ57ghwwcx5V96lrDCtS2HYV9q7OJtXnGxMJvxQkekc64xlR7RvD2rphNEFEM21mUEt7QYbNwNnZd1w+F8ETqSKIqWCniinSSYPaH+nztubnFoXZRV5K7POlh8XCIkV12jJvQ7/WcXPmY+ixUrwFpQXfITenjExL/DmjzJ92pNsDO3pMIFLlqaBVai53PLbL3Svp5V5a/wf5uySLFzT90FQOzkM60h71yFqY0DK/Euo27cbA3YNAYrUvfHwkc0sNUoP+L3wCJG/Q7+n4YRwi5iRkgBT7APHSWh/aDo87iPfjLRBjmpovAJVZ0z2dZito/7LSGBqeZyjhqMB9S3/beO1tSIJA8zi5Lb5rWEFg5bncsrAe39pf8Bq85Dr1L8T/SGdwocGPXfRhVKYsqL8rWeAZX+Xf7Pa9sgCHfzPrXyR5dMrtTPTEPm9njHIyeHfBNOd8LSc1yY+5mtbo323Lvxsige9KG9o1XjQ97ADqb8bePTOp9FYg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b7599504-bd4a-4817-d624-08da3818aff4 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9186.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2022 15:19:51.1899 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SAj7EdinG43n2cke00ZvuzAa6nl2S5Kaew/+v6YMuBZDldYIVyWkEqvJGXPmgXcF2cbNVR2/BbodcH1tc9Tgkw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2285 Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org struct dw_edma_region rg_region included virtual address, physical address and size information. But only virtual address is used by EDMA driver. Change it to void __iomem *reg_base to clean up code. Signed-off-by: Frank Li Reviewed-by: Serge Semin Reviewed-by: Manivannan Sadhasivam Tested-by: Serge Semin Tested-by: Manivannan Sadhasivam --- Change from v6 to v11: - none Change from v5 to v6: -s/change/Change at subject New patch at v4 drivers/dma/dw-edma/dw-edma-pcie.c | 6 +++--- drivers/dma/dw-edma/dw-edma-v0-core.c | 2 +- drivers/dma/dw-edma/dw-edma-v0-debugfs.c | 2 +- include/linux/dma/edma.h | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/dma/dw-edma/dw-edma-pcie.c b/drivers/dma/dw-edma/dw-edma-pcie.c index 2c1c5fa4e9f28..ae42bad24dd5a 100644 --- a/drivers/dma/dw-edma/dw-edma-pcie.c +++ b/drivers/dma/dw-edma/dw-edma-pcie.c @@ -233,8 +233,8 @@ static int dw_edma_pcie_probe(struct pci_dev *pdev, chip->wr_ch_cnt = vsec_data.wr_ch_cnt; chip->rd_ch_cnt = vsec_data.rd_ch_cnt; - chip->rg_region.vaddr = pcim_iomap_table(pdev)[vsec_data.rg.bar]; - if (!chip->rg_region.vaddr) + chip->reg_base = pcim_iomap_table(pdev)[vsec_data.rg.bar]; + if (!chip->reg_base) return -ENOMEM; for (i = 0; i < chip->wr_ch_cnt; i++) { @@ -299,7 +299,7 @@ static int dw_edma_pcie_probe(struct pci_dev *pdev, pci_dbg(pdev, "Registers:\tBAR=%u, off=0x%.8lx, sz=0x%zx bytes, addr(v=%p)\n", vsec_data.rg.bar, vsec_data.rg.off, vsec_data.rg.sz, - chip->rg_region.vaddr); + chip->reg_base); for (i = 0; i < chip->wr_ch_cnt; i++) { diff --git a/drivers/dma/dw-edma/dw-edma-v0-core.c b/drivers/dma/dw-edma/dw-edma-v0-core.c index 999e038961866..403ade40c1b1b 100644 --- a/drivers/dma/dw-edma/dw-edma-v0-core.c +++ b/drivers/dma/dw-edma/dw-edma-v0-core.c @@ -25,7 +25,7 @@ enum dw_edma_control { static inline struct dw_edma_v0_regs __iomem *__dw_regs(struct dw_edma *dw) { - return dw->chip->rg_region.vaddr; + return dw->chip->reg_base; } #define SET_32(dw, name, value) \ diff --git a/drivers/dma/dw-edma/dw-edma-v0-debugfs.c b/drivers/dma/dw-edma/dw-edma-v0-debugfs.c index b765adb969998..5226c9014703c 100644 --- a/drivers/dma/dw-edma/dw-edma-v0-debugfs.c +++ b/drivers/dma/dw-edma/dw-edma-v0-debugfs.c @@ -288,7 +288,7 @@ void dw_edma_v0_debugfs_on(struct dw_edma *_dw) if (!dw) return; - regs = dw->chip->rg_region.vaddr; + regs = dw->chip->reg_base; if (!regs) return; diff --git a/include/linux/dma/edma.h b/include/linux/dma/edma.h index 86697d33e0610..195ee1e47f21d 100644 --- a/include/linux/dma/edma.h +++ b/include/linux/dma/edma.h @@ -39,6 +39,7 @@ enum dw_edma_map_format { * @id: instance ID * @nr_irqs: total dma irq number * @ops DMA channel to IRQ number mapping + * @reg_base DMA register base address * @wr_ch_cnt DMA write channel number * @rd_ch_cnt DMA read channel number * @rg_region DMA register region @@ -55,7 +56,7 @@ struct dw_edma_chip { int nr_irqs; const struct dw_edma_core_ops *ops; - struct dw_edma_region rg_region; + void __iomem *reg_base; u16 wr_ch_cnt; u16 rd_ch_cnt;