Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp214221rdb; Thu, 21 Dec 2023 07:15:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IHSI9C1Ah780TUgrxO17tUYwkQRI9I2cPqccel8DFw/3AQWRXm4KxPTWkYLgVFkMNIdszVG X-Received: by 2002:a17:903:32c5:b0:1d3:9f6e:cd89 with SMTP id i5-20020a17090332c500b001d39f6ecd89mr10806190plr.98.1703171736776; Thu, 21 Dec 2023 07:15:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1703171736; cv=pass; d=google.com; s=arc-20160816; b=QMkuriFHy1dhkl/RaDCoL/lEnzPw+XL5uP5N8jYtMV3EQ4KmRB+sV+HcUN6fqxu3ev KBavkNOKvhMtD2DZryVRolrOmgC+Bg1vKwCxsLYkWAgxRK4liMy0dyiDF6iVVWdVOET1 yj8nICg+AGg+vMyA8BUwD7ATHAB0ppqTLMQXapHJeSPEiRAY5k0NZLPc2bBoz7hvX0H3 3DqfHaFeS7DhNEiR9dhClN6aM5CygdjqPpN1zPeSe2AOe5PxwsFl3E5kfZmtU+sVTnTS ZwluBaqXqfcYRlniYWtSZZTBjD4VpOK8YXsNAMM8ZTdYa4ufR5jCK5M3ntqxKPjXHvNn 1txQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :in-reply-to:content-transfer-encoding:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=kyJaGYe/CRcrs+2pC5+M7st6A9DuQcDIFH+zra0srXg=; fh=bMiy8NoTPAkRPqXHQ9GJ75J+mFXIdJssiDNqZ8hi67Y=; b=tCM295AUJ0bqGhpP1B0bZ4Coypkv+myH72Ye5qUoUNkNYzlFzeVF+Kw02X+jm36GBH /ruwCRJ2AULqoT/GiRj/OnhKy0B4+qjag5kf8TRhPoWB7F9oueS7QSIMMe4P8eglS3SU rBaRPjsrrMovBsJkRof0tKR09BQgPj3hP/3oNvImzBhTjdieYprekfMnlYzr+lEheaIy 6mNWgqVrfk4A+rKawrM0qoOGyZdyy48/C+VrwGalnQ6YWc8cjF0NkIQLOhpC4EmmAPWl BiucQVtQjbzJ1y/6pfvkYYliDdI044Rn2GtWRTClOuaTif2ZeiJw8tEtQbpChMEpNizg 1omg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=qite+Xp8; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel+bounces-8627-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8627-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id v7-20020a170902b7c700b001d408c45e49si1043553plz.489.2023.12.21.07.15.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 07:15:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8627-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=qite+Xp8; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel+bounces-8627-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8627-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 45C66286693 for ; Thu, 21 Dec 2023 15:14:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 78A244EB4F; Thu, 21 Dec 2023 15:14:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="qite+Xp8" X-Original-To: linux-kernel@vger.kernel.org Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on2088.outbound.protection.outlook.com [40.107.14.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 31957539E4; Thu, 21 Dec 2023 15:14:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NVaxBpyjCE4mN3U7XPkLHdx/FQiEBlk/ypiRvk7ehJR3IgoEuaIZiroISNVMq/aTZczj39JFHNP5klv0zxtc/vbM5s/PDwt6pfa3hE+cBx1IYtcG8DLzB0xEue5hpchiCaaCg0DvnX+sB5UHbbvRml9OUQBYZFhZQjp+tUiJCHYoeaeRp0CaodqyNvf4dPUXQCsmjCpdKyF/AIKoaVbab8/WqX8jumUTuqnTa2e3fubxw/vg47C3VbXHDSjjZnokSbR6PkWS2vl7tR27MIVHcfL3BQBi9+chCzw7AWeEBJBcw/zoFvvnTBl7SHhyEQKKMhtAbpPYzQ3LLTQed4HxuA== 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=kyJaGYe/CRcrs+2pC5+M7st6A9DuQcDIFH+zra0srXg=; b=TVzrEkaCLGxg0DAEkjH1BbRbOLNgK3kb387pnAqwOcigAe7osYlAWtE76Yt3gIz4RPQW9KW5btbNL/dFEOof1N6zm1b4L/U2bWIPUucTIT7XEATLjVyPe2S4QaIOZhxEoDETmiF3RJYDpZrAhuNN6y0fxdOkbrJGi0WwRU4s0QVMfcpbpZIa3Pp4oOoILssvHdPOjRD274TYZuovQrDB3VJ1PIoN3QLOcDxHhupY1uWWsQxM3/zplA726PudxJFRvhNvzDl+1XL4eYfw02QD9+WEa8+WOJ6YFmGEv8enhSHzfbScIy2BuiunPGNDaB3NQ+H4ikTny8ni978NneAmQA== 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=kyJaGYe/CRcrs+2pC5+M7st6A9DuQcDIFH+zra0srXg=; b=qite+Xp8SYUvfthzS+SjyFFrpSOUPWP2CBi0A1B/BDJnyAmFGWTQ3xLvA3XQFDqUzYZ9J/GdWAxIjCwh7MxRsetQzdf5VXxtpOusVN1qFgtkmlKYhElINT4xSiQh5bjnMyWip2Nx6h15OeCID2/cbpjZmevSyrF+LSpHw4t/xQ0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by DBBPR04MB7529.eurprd04.prod.outlook.com (2603:10a6:10:208::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.18; Thu, 21 Dec 2023 15:14:38 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40%7]) with mapi id 15.20.7113.019; Thu, 21 Dec 2023 15:14:38 +0000 Date: Thu, 21 Dec 2023 10:14:31 -0500 From: Frank Li To: Joy Zou Cc: "vkoul@kernel.org" , "devicetree@vger.kernel.org" , "dmaengine@vger.kernel.org" , "imx@lists.linux.dev" , "krzysztof.kozlowski+dt@linaro.org" , "linux-kernel@vger.kernel.org" , Peng Fan , "robh+dt@kernel.org" , Shenwei Wang Subject: Re: [PATCH v3 6/6] dmaengine: fsl-edma: integrate TCD64 support for i.MX95 Message-ID: References: <20231127225542.2744711-1-Frank.Li@nxp.com> <20231127225542.2744711-7-Frank.Li@nxp.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: SJ2PR07CA0005.namprd07.prod.outlook.com (2603:10b6:a03:505::29) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DBBPR04MB7529:EE_ X-MS-Office365-Filtering-Correlation-Id: 0e514ea0-d460-4192-affe-08dc02378ca1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 16aqbn64E6IEl9wFsv7doDrVKvwO6nKPg06BTmQ17775+q9GaMESvoqjYZvdFkXlThcBoPjh+fDnGbHa2Mxlil/wCRXYc8QP82liaW07FgfnBHlleVcpNwhi9F6DwaduQ8dDKA+XKZR1bSDe6rBp10m+FYkBXFYflx8PH+bWUeBjHDnCP8BAxhetpT4stxVXJ8TFzoZjJsoPQGEFuL4QpbqM7NNobOMsNhCbN943/OHtITgF6f3pwiyoISqjOaN/zMXbFMMRTXnYCWbuS7K/6peaTizmd4qJThgOLFTAdwS/9leUBpxphB1z2LkSRHXzYFd2/gj05E/YmsLvF2Fs2YJew9fXR75BffjeeF8+BDt4PSUiEuE3Y9eJips5zIUDVl0OL4+axhAPAxJc5sxSChZb/EbuzUq1j5AwgpaTqW46Ebw7PRfe3UQnJhA0jxsO6YYiGMLXYeS+U1993CzfAffGWWYcTmm/dxu9h2GdhxLdvR9YOzO/h3s3FxJh0NkGp9GXoMFTXFycIErwC6tEB7OoaNunAWQZlQnbAAJUQYoYlINKnAd5zUGukzgalrrDLrRw7UmoJbrvetmQHZ+lsKlPbKeKqs5V8Icp3i8etAwgnGHPPTOIXKQG8LvVYwYjy61Ff6K5W2UfNHRrZwmglg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4838.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7916004)(376002)(136003)(346002)(396003)(366004)(39860400002)(230922051799003)(186009)(1800799012)(64100799003)(451199024)(52116002)(53546011)(6512007)(9686003)(86362001)(6506007)(26005)(6666004)(478600001)(66946007)(54906003)(66556008)(66476007)(6636002)(6486002)(83380400001)(316002)(38100700002)(38350700005)(2906002)(8936002)(5660300002)(8676002)(6862004)(4326008)(33716001)(41300700001)(67856001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RzU3SnBQWWcxeUkxTDhOZ0pRWjRhbStLaDZra3dldXBXZGQxU3pPYjdkY1JM?= =?utf-8?B?QVo1MjVCaVBBVkp5OU5NTGRHZ281SnZRblZZUi94UEI1akpGSHpQL29NN1Fs?= =?utf-8?B?VW5jcm83QWg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UHFHcURucXho?= =?utf-8?B?eUxVZ3p1Tkhya2p4eVVGblBLVmVQZEpoclcxaDV5TGw3QThzLzJJb2w0RGd1?= =?utf-8?B?UWpYckxDZTdiUnlvMFdCcCszRHB0WVVJTlp2dzlZT0ZkemRUS3oyUTZ5NWRN?= =?utf-8?B?RVJuR1Y2ZU1jd3hWV0FaRHQwL0JPczlEUEtLc29Nb2hNUFIzMFM5UjloOW56?= =?utf-8?Q?7gYM=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0e514ea0-d460-4192-affe-08dc02378ca1 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2023 15:14:38.7020 (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: IFPFQ/UIl3glt98zXNK+8Ydnvo3RAAMm4R3zylcJQrJQsvh8/KoKTffEhf9nMm9aqUoX5SGYcAdgXHa1ZfZOSw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7529 On Thu, Dec 21, 2023 at 07:47:19AM +0000, Joy Zou wrote: > Hi frank, > > -----Original Message----- > > From: Frank Li > > Sent: 2023年11月28日 6:56 > > To: Frank Li ; vkoul@kernel.org > > Cc: devicetree@vger.kernel.org; dmaengine@vger.kernel.org; > > imx@lists.linux.dev; Joy Zou ; > > krzysztof.kozlowski+dt@linaro.org; linux-kernel@vger.kernel.org; Peng Fan > > ; robh+dt@kernel.org; Shenwei Wang > > > > Subject: [PATCH v3 6/6] dmaengine: fsl-edma: integrate TCD64 support for > > i.MX95 > > > > In i.MX95's edma version 5, the TCD structure is extended to support 64-bit > > addresses for fields like saddr and daddr. To prevent code duplication, employ > > help macros to handle the fields, as the field names remain the same between > > TCD and TCD64. > > > > Change local variables related to TCD addresses from 'u32' to 'dma_addr_t' > > to accept 64-bit DMA addresses. > > > > Change 'vtcd' type to 'void *' to avoid direct use. Use helper macros to access > > the TCD fields correctly. > > > > Call 'dma_set_mask_and_coherent(64)' when TCD64 is supported. > > > > Signed-off-by: Frank Li > > --- > > drivers/dma/fsl-edma-common.c | 34 ++++--- > > drivers/dma/fsl-edma-common.h | 165 > > +++++++++++++++++++++++++++------- > > drivers/dma/fsl-edma-main.c | 14 +++ > > 3 files changed, 170 insertions(+), 43 deletions(-) > > > > diff --git a/drivers/dma/fsl-edma-common.c > > b/drivers/dma/fsl-edma-common.c index 65f466ab9d4da..c8acff09308fd > > 100644 > > --- a/drivers/dma/fsl-edma-common.c > > +++ b/drivers/dma/fsl-edma-common.c > > @@ -351,7 +351,7 @@ static size_t fsl_edma_desc_residue(struct > > fsl_edma_chan *fsl_chan, { > > struct fsl_edma_desc *edesc = fsl_chan->edesc; > > enum dma_transfer_direction dir = edesc->dirn; > > - dma_addr_t cur_addr, dma_addr; > > + dma_addr_t cur_addr, dma_addr, old_addr; > > size_t len, size; > > u32 nbytes = 0; > > int i; > > @@ -367,10 +367,16 @@ static size_t fsl_edma_desc_residue(struct > > fsl_edma_chan *fsl_chan, > > if (!in_progress) > > return len; > > > > - if (dir == DMA_MEM_TO_DEV) > > - cur_addr = edma_read_tcdreg(fsl_chan, saddr); > > - else > > - cur_addr = edma_read_tcdreg(fsl_chan, daddr); > > + /* 64bit read is not atomic, need read retry when high 32bit changed */ > > + do { > > + if (dir == DMA_MEM_TO_DEV) { > > + old_addr = edma_read_tcdreg(fsl_chan, saddr); > > + cur_addr = edma_read_tcdreg(fsl_chan, saddr); > > + } else { > > + old_addr = edma_read_tcdreg(fsl_chan, daddr); > > + cur_addr = edma_read_tcdreg(fsl_chan, daddr); > > + } > > + } while (upper_32_bits(cur_addr) != upper_32_bits(old_addr)); > > > > /* figure out the finished and calculate the residue */ > > for (i = 0; i < fsl_chan->edesc->n_tcds; i++) { @@ -426,8 +432,7 @@ > > enum dma_status fsl_edma_tx_status(struct dma_chan *chan, > > return fsl_chan->status; > > } > > > > -static void fsl_edma_set_tcd_regs(struct fsl_edma_chan *fsl_chan, > > - struct fsl_edma_hw_tcd *tcd) > > +static void fsl_edma_set_tcd_regs(struct fsl_edma_chan *fsl_chan, void > > +*tcd) > > { > > u16 csr = 0; > > > > @@ -478,9 +483,9 @@ static void fsl_edma_set_tcd_regs(struct > > fsl_edma_chan *fsl_chan, > > > > static inline > > void fsl_edma_fill_tcd(struct fsl_edma_chan *fsl_chan, > > - struct fsl_edma_hw_tcd *tcd, u32 src, u32 dst, > > - u16 attr, u16 soff, u32 nbytes, u32 slast, u16 citer, > > - u16 biter, u16 doff, u32 dlast_sga, bool major_int, > > + struct fsl_edma_hw_tcd *tcd, dma_addr_t src, dma_addr_t > > dst, > > + u16 attr, u16 soff, u32 nbytes, dma_addr_t slast, u16 citer, > > + u16 biter, u16 doff, dma_addr_t dlast_sga, bool major_int, > > bool disable_req, bool enable_sg) { > > struct dma_slave_config *cfg = &fsl_chan->cfg; @@ -581,8 +586,9 @@ > > struct dma_async_tx_descriptor *fsl_edma_prep_dma_cyclic( > > dma_addr_t dma_buf_next; > > bool major_int = true; > > int sg_len, i; > > - u32 src_addr, dst_addr, last_sg, nbytes; > > + dma_addr_t src_addr, dst_addr, last_sg; > > u16 soff, doff, iter; > > + u32 nbytes; > > > > if (!is_slave_direction(direction)) > > return NULL; > > @@ -654,8 +660,9 @@ struct dma_async_tx_descriptor > > *fsl_edma_prep_slave_sg( > > struct fsl_edma_chan *fsl_chan = to_fsl_edma_chan(chan); > > struct fsl_edma_desc *fsl_desc; > > struct scatterlist *sg; > > - u32 src_addr, dst_addr, last_sg, nbytes; > > + dma_addr_t src_addr, dst_addr, last_sg; > > u16 soff, doff, iter; > > + u32 nbytes; > > int i; > > > > if (!is_slave_direction(direction)) > > @@ -804,7 +811,8 @@ int fsl_edma_alloc_chan_resources(struct dma_chan > > *chan) > > struct fsl_edma_chan *fsl_chan = to_fsl_edma_chan(chan); > > > > fsl_chan->tcd_pool = dma_pool_create("tcd_pool", chan->device->dev, > > - sizeof(struct fsl_edma_hw_tcd), > > + fsl_edma_drvflags(fsl_chan) & FSL_EDMA_DRV_TCD64 ? > > + sizeof(struct fsl_edma_hw_tcd64) : sizeof(struct > > fsl_edma_hw_tcd), > > 32, 0); > > return 0; > > } > > diff --git a/drivers/dma/fsl-edma-common.h > > b/drivers/dma/fsl-edma-common.h index 4f39a548547a6..6afceb9fded1b > > 100644 > > --- a/drivers/dma/fsl-edma-common.h > > +++ b/drivers/dma/fsl-edma-common.h > > @@ -87,6 +87,20 @@ struct fsl_edma_hw_tcd { > > __le16 biter; > > }; > > > > +struct fsl_edma_hw_tcd64 { > > + __le64 saddr; > > + __le16 soff; > > + __le16 attr; > > + __le32 nbytes; > > + __le64 slast; > > + __le64 daddr; > > + __le64 dlast_sga; > > + __le16 doff; > > + __le16 citer; > > + __le16 csr; > > + __le16 biter; > > +} __packed; > > + > > struct fsl_edma3_ch_reg { > > __le32 ch_csr; > > __le32 ch_es; > > @@ -96,7 +110,10 @@ struct fsl_edma3_ch_reg { > > __le32 ch_mux; > > __le32 ch_mattr; /* edma4, reserved for edma3 */ > > __le32 ch_reserved; > > - struct fsl_edma_hw_tcd tcd; > > + union { > > + struct fsl_edma_hw_tcd tcd; > > + struct fsl_edma_hw_tcd tcd64; > > + }; > > } __packed; > The tcd64 should be fsl_edma_hw_tcd64? > BR With help macro, it is not imporant, only used to caculate ch_reg address from tcd address. Anyway, it should change to fsl_edma_hw_tcd64 for better maintaince. Frank > Joy Zou > > > > /* > > @@ -125,7 +142,7 @@ struct edma_regs { > > > > struct fsl_edma_sw_tcd { > > dma_addr_t ptcd; > > - struct fsl_edma_hw_tcd *vtcd; > > + void *vtcd; >