Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp475909lqr; Wed, 5 Jun 2024 11:15:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV1FYQZmdpmUE8nB6UwYlcE32j4yjR9XNhpLOVsTOBJcpNcu4IO9Qdxn5z7b+47Iig3YdWNl+mZbEJHwUc1bpZ3sUAcNOGChR3/ydQusQ== X-Google-Smtp-Source: AGHT+IFa0iHlRofbUQDNyEjjrcyDYAn0lMwAE2RkxDUyqKtrKYctqhW6lL8GwMQ2LLAQzZZ1ZHcU X-Received: by 2002:a17:906:2808:b0:a59:9b75:b90 with SMTP id a640c23a62f3a-a699f34a886mr216466266b.2.1717611309218; Wed, 05 Jun 2024 11:15:09 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a68f1b86ea8si400814666b.857.2024.06.05.11.15.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 11:15:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203047-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=h3jVZY0q; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-203047-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203047-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 4124E1F22B20 for ; Wed, 5 Jun 2024 18:15:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A70C413C91C; Wed, 5 Jun 2024 18:13:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="h3jVZY0q" Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2053.outbound.protection.outlook.com [40.107.249.53]) (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 5312D2C95; Wed, 5 Jun 2024 18:13:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.249.53 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717611223; cv=fail; b=bF8ZJK0LlUV4frntMXSWQi2XNUsJONYdeRApeLlM2GIQQ0Vt6tOjb2n4GDrNv+W0S/eYwjP6ujZlxYNw52fWrbFpr3L/dz8xJh/rniNpRTf4Fu+tj75b0kwOe9SxicsWF6kFpiZp7fDrochvVRfWmZZcczvfcL2snriTPNTgqMA= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717611223; c=relaxed/simple; bh=0V/1hgl/8YiDNTXTHDkxZw7P9jqYWrqNZBgrsDUShAQ=; h=Date:From:To:Cc:Subject:Message-ID:References:Content-Type: Content-Disposition:In-Reply-To:MIME-Version; b=RQ87r4nUvSQGiJGzOlwph10wox2r7TXKj5j2ezovmpSp2e7iTY5n5Mvl8Db48++3hCNq42AS9k3rRaVD9toM7qObUW0CrME7sjeEYC2LTCyoMEuz/6oJvAWz0/yAkR09qF975xGv35jHH7nGfKd/1xXkXn22H9nJt51iLZqilvU= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=h3jVZY0q; arc=fail smtp.client-ip=40.107.249.53 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=C4RXyqxeXjfzSLzBiJucJ7TeHIg7lJGN1RFMQtrzbQZOjpbGFAJoNEV8pLVhfHFNKxcITviLJd9qG27QY0T9lqECDGkfVclbWOwU82MyPeutcqCrWQGSBPcy8cJ0WwLxvDiz3LqVoFPfS+kXNCeqiBtUzTCrgGoHtIYGDD/BKUZ8q6/EfxKB2IRxdzv4EFhdvrASPj4eEgJ2d//vpSPw4CwvaOWck1WuT4vYF9krXrbtqzOUKP1P69JCIjYeSdBwNJ6UI+LH0VzSif8QRbYn9lGr9yVmSulqaXm0ZmeKfRHVGrv9YWIVhKjH2x56Ju0xgpFZL41ctfboUDM365BxiA== 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=Y7Vg1M2oFwK6yYwf+jz0/fn9iNOAJKJako3w38JvBa0=; b=gX3ivc+Dgf4AjEyd2+wk0xvUj8PxoatmHrNHC1Y42zhMvYE5fXPh+IcGZfQCk7MJw8u8TMdVDXuc7DudMRnpC6jKLaV0cnp0G6b1SfMqqUy8dUfXK5IYULEgNMzWufqa9DO739OXelgpwR8Gfq+zNLjRl3cVj1iQUnTyu70XPDYk0l2X2tczOka2Gwze47TmYSZ1AspjdtOKEKbveLbOzZFFBo6+mMiUcmEdipJX7FbxpM+IzUlzAgTJsiwbZhk8vdjLvuc6IFEOw5uTEYGA6INQYKu6ar54mDWBTFcXg3J39mA6wIEeLAD7QyDUIzEHNwu1Vpr/glwVg8ZPD8dNlg== 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=Y7Vg1M2oFwK6yYwf+jz0/fn9iNOAJKJako3w38JvBa0=; b=h3jVZY0qmJvaTLMCG/WmDma5t1hhlLYBll7PfsdTUecGLoWtwoIz+tSuGJWRjhbd86cUPna+zhrKSvbzKyhzNjW3P5+9NLEq3kXDiXgnA8ceTdnq9f9DhlemIzJ7+OCVtKhBrvcbVxN95Qms1KAwydIFdEZys+uhVHprOBSe06M= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by PA1PR04MB10323.eurprd04.prod.outlook.com (2603:10a6:102:44e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.31; Wed, 5 Jun 2024 18:13:38 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%2]) with mapi id 15.20.7633.021; Wed, 5 Jun 2024 18:13:38 +0000 Date: Wed, 5 Jun 2024 14:13:26 -0400 From: Frank Li To: Dave Stevenson Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Broadcom internal kernel review list , Ray Jui , Scott Branden , Vinod Koul , Maxime Ripard , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Ulf Hansson , Mark Brown , Christoph Hellwig , Marek Szyprowski , Robin Murphy , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Vladimir Murzin , Phil Elwell , Stefan Wahren , Serge Semin , devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mmc@vger.kernel.org, linux-spi@vger.kernel.org, iommu@lists.linux.dev, linux-sound@vger.kernel.org Subject: Re: [PATCH 09/18] dmaengine: bcm2835: Add function to handle DMA mapping Message-ID: References: <20240524182702.1317935-1-dave.stevenson@raspberrypi.com> <20240524182702.1317935-10-dave.stevenson@raspberrypi.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240524182702.1317935-10-dave.stevenson@raspberrypi.com> X-ClientProxiedBy: SJ0P220CA0019.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::35) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) 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: PAXPR04MB9642:EE_|PA1PR04MB10323:EE_ X-MS-Office365-Filtering-Correlation-Id: cdbc0140-0393-46a5-1427-08dc858b393b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|52116005|7416005|366007|376005|38350700005; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?d7IKPpghG1nZP+Q7fsPN/jAAFOa9gUecZUw6WXe0S0VZ9BjwplCuiiO/qd72?= =?us-ascii?Q?T8J7ymqHfP9GoysHU0t8fzzgZv/TOB4w8DJjM2qdQoAMjh98swr2TWcG+gav?= =?us-ascii?Q?r7E1IxlP4ziT7Cv0JU+TYU0VontZl7wMl6kA817uFSEDzv/WM832GMwaR3l0?= =?us-ascii?Q?0XCUtYz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KbDsDmzj9Lq?= =?us-ascii?Q?mTQNhwJhljgZz3juIOyk9h2klBvqHZ5qd0PLEKZPqJMlkqNeFncOHx6oE7XE?= =?us-ascii?Q?KqC/UC6/aYxjyI8tH3rtAGt5PefiY/LYbPOzZlS+DV07cggLASL+9O+KPIhs?= =?us-ascii?Q?/2Vrbc4idi7+WdQ7qK0m5ZGwitKa6+OaeAqg8Mtg2Z5Y2tat/pJj+EKOcj9C?= =?us-ascii?Q?aRWy4NPQ5MezuR8cRKUfTv43cJmj4aO5Y7zi0FKp5NHUUHe5Cd6httv8ioMS?= =?us-ascii?Q?I1qKpS+AEpYP7eTmy9koTOF7ZD4bAZ5cIW/hGGlhGMBfVg=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(52116005)(7416005)(366007)(376005)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?KTynahmYKFvKfokWmxXl0RelbBO5yyv0Zv8IqgkP+7p2e5uGAXkuG/Kcx2bD?= =?us-ascii?Q?Vrfbcb1hdAwu+9tcRoKIqWyC+1bbfGxnrbex+KlnJsyMLmiAmKewHYNMEjN7?= =?us-ascii?Q?Lcy4iC+aU6i8PuFzIS8ca4E1dvikT4X8wHTf/lfJ857TEIWEhpScWQTxzJoU?= =?us-ascii?Q?wZuk3ViMiHRSoj1ualJZGsS0CNLy4MFkMt5W/wn8Z4TN1Z61BrAr0MfPULIl?= =?us-ascii?Q?63+yt91EYiZZq4h7DWSNGwxTYVm4Vca+2TUMZgMwUMN3rj0z/UYwZ5StLzU5?= =?us-ascii?Q?BhF0pONmucJsAWpPl+wVz+bzNNPeTUXnriWlrx7HHLUlLMd0X2MibclX888S?= =?us-ascii?Q?3P6Z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O6ZeneilKO01pQj7?= =?us-ascii?Q?TMq0pEVCIdkv8CiA4mwY7qbD+VyOm8uQfFBo6/K6ESaZfDnrW1et5YlTm5cI?= =?us-ascii?Q?VtpOwv54wkDwy01afH5R6YJHBoCFJrgf5xkZuiPhmAC/Bhtl/6yLrap9cB3B?= =?us-ascii?Q?JimhaBNx5ODnqOFEOPTWERUG/CP8UatkaFHOdyzGoyCWYosCvrYnkcV6+yQ0?= =?us-ascii?Q?Q98r0Es1HVWf+7KMrmqZx/Nv1xL/VUhaPR7TpaAj0/PoqBEl6eoNxKkAbFxw?= =?us-ascii?Q?co4iUy7ehBv0FXxHUyGeJYXdhm5tP+f2PkaswwavGDtsbLaPqwxMAvGq+U5k?= =?us-ascii?Q?I7k5i99661rqd3a+cf4=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cdbc0140-0393-46a5-1427-08dc858b393b X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2024 18:13:38.7609 (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: uFOMKP7i7WE1kAbCSBZo0yHsYqDGm5UtZCAqnXxoeQldtUvxW8EDwoVwSOGIs8TpY29Gya/ST4MLMNz423dS4A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA1PR04MB10323 On Fri, May 24, 2024 at 07:26:53PM +0100, Dave Stevenson wrote: > The code handling DMA mapping is currently incorrect and > needs a sequence of fixups. Can you descript what incorrect here? > Move the mapping out into a separate function and structure > to allow for those fixes to be applied more cleanly. > > Signed-off-by: Dave Stevenson > --- > drivers/dma/bcm2835-dma.c | 46 ++++++++++++++++++++++++++++++++------- > 1 file changed, 38 insertions(+), 8 deletions(-) > > diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c > index aefaa1f01d7f..ef1d95bae84e 100644 > --- a/drivers/dma/bcm2835-dma.c > +++ b/drivers/dma/bcm2835-dma.c > @@ -65,6 +65,10 @@ struct bcm2835_cb_entry { > dma_addr_t paddr; > }; > > +struct bcm2835_dma_chan_map { > + dma_addr_t addr; > +}; > + > struct bcm2835_chan { > struct virt_dma_chan vc; > > @@ -74,6 +78,7 @@ struct bcm2835_chan { > int ch; > struct bcm2835_desc *desc; > struct dma_pool *cb_pool; > + struct bcm2835_dma_chan_map map; I suppose map should in bcm2835_desc. if put in chan, how about client driver create two desc by bcm2835_dma_prep_slave_sg()? prep_slave_sg() submit() prep_savle_sg() submit() issue_pending() Frank > > void __iomem *chan_base; > int irq_number; > @@ -268,6 +273,19 @@ static inline bool need_dst_incr(enum dma_transfer_direction direction) > } > > return false; > +}; > + > +static int bcm2835_dma_map_slave_addr(struct dma_chan *chan, > + phys_addr_t dev_addr, > + size_t dev_size, > + enum dma_data_direction dev_dir) > +{ > + struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); > + struct bcm2835_dma_chan_map *map = &c->map; > + > + map->addr = dev_addr; > + > + return 0; > } > > static void bcm2835_dma_free_cb_chain(struct bcm2835_desc *desc) > @@ -734,13 +752,19 @@ static struct dma_async_tx_descriptor *bcm2835_dma_prep_slave_sg( > } > > if (direction == DMA_DEV_TO_MEM) { > - if (c->cfg.src_addr_width != DMA_SLAVE_BUSWIDTH_4_BYTES) > + if (bcm2835_dma_map_slave_addr(chan, c->cfg.src_addr, > + c->cfg.src_addr_width, > + DMA_TO_DEVICE)) > return NULL; > - src = c->cfg.src_addr; > + > + src = c->map.addr; > } else { > - if (c->cfg.dst_addr_width != DMA_SLAVE_BUSWIDTH_4_BYTES) > + if (bcm2835_dma_map_slave_addr(chan, c->cfg.dst_addr, > + c->cfg.dst_addr_width, > + DMA_FROM_DEVICE)) > return NULL; > - dst = c->cfg.dst_addr; > + > + dst = c->map.addr; > } > > /* count frames in sg list */ > @@ -795,14 +819,20 @@ static struct dma_async_tx_descriptor *bcm2835_dma_prep_dma_cyclic( > __func__, buf_len, period_len); > > if (direction == DMA_DEV_TO_MEM) { > - if (c->cfg.src_addr_width != DMA_SLAVE_BUSWIDTH_4_BYTES) > + if (bcm2835_dma_map_slave_addr(chan, c->cfg.src_addr, > + c->cfg.src_addr_width, > + DMA_TO_DEVICE)) > return NULL; > - src = c->cfg.src_addr; > + > + src = c->map.addr; > dst = buf_addr; > } else { > - if (c->cfg.dst_addr_width != DMA_SLAVE_BUSWIDTH_4_BYTES) > + if (bcm2835_dma_map_slave_addr(chan, c->cfg.dst_addr, > + c->cfg.dst_addr_width, > + DMA_FROM_DEVICE)) > return NULL; > - dst = c->cfg.dst_addr; > + > + dst = c->map.addr; > src = buf_addr; > } > > -- > 2.34.1 >