Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp258387rdb; Mon, 22 Jan 2024 03:21:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IEpMXQkRzX9EA2VQQlQ1QApaNcUFQixBaLH4NlKrMKEpQjAVhbOrD2tJf6LubgcFJmJunvN X-Received: by 2002:a05:620a:88a:b0:783:9a92:a6ed with SMTP id b10-20020a05620a088a00b007839a92a6edmr2450558qka.29.1705922504373; Mon, 22 Jan 2024 03:21:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705922504; cv=pass; d=google.com; s=arc-20160816; b=mV71HtXxQGNRIB1WnfQ2dElC5sXHugvdjmneUmStawbIuT/OBxpP+/z7RNopDD4grQ EuHu/XTIXdFQpybwVY8NfBbAoAP/wQgTJO8jI4tSR7uiBRL9HG0KHQZ2/JQaH3qUW2mK XZlBlT0RRY+rKzYJT9HssPXpLWc4QqwpydQCf2T7ofYuzAiPV53Zd+2rGtm8uKe+PGd2 VwadV+IFfIAtQu1H+ctk5e3R/Ce80hmdWWE+Zw2XdlAyM0znu3dD0v453ZMRcbGsQ1ta rxx5jImdpKLjuWJ1EbauMat0g3u9GSJ0y/ZdUAhj+z9KaM9UXW29hiMueL0wfyJNx62Y miKA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=dpmg+UzP7BILD/KCR9PMY1tFzhfSYIi5ZsF0mJ2TN2A=; fh=ZLUuwjxxYy1jNEgd4cgiALDmZQo914Hf5x1Towe5R+A=; b=rpLoTL4M3CVL4I8uSQj34M5KnHefqLN9jGG0hMaKuqunRejMVv9hAxuNdi6OkLdfnx lPMceUrMPuCAMRCl8+Ag0jqtHoFjo/KcJvawWhx6959KQmRuamw5lWNjq6bUXGUG9P3K J1Q27SxMKTCTIR7SCZqq8EeeJ9sajjp7gOocL3YcWOuQkgImZITezWx7G5F/uLINGnWw c2I2kR2JuAzJYGE7Xo7zCNilhVmmk2wJtrAOTz8zuXRqIh21xBLGdSDJY6Yhmwp2O9wy YfkGMnfEBAMpIco9fYI+tBNBfJTa0rMt/7Wo4LjrDMtQA84QWhKkFSJs5QCHBq5biztw quRA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sT8RYILN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-32863-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32863-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id s15-20020a05620a29cf00b007835b33c34csi5394815qkp.470.2024.01.22.03.21.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 03:21:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-32863-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sT8RYILN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-32863-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32863-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 852BA1C246B7 for ; Mon, 22 Jan 2024 11:20:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DA5543C07B; Mon, 22 Jan 2024 11:06:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sT8RYILN" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 09B483A8CF; Mon, 22 Jan 2024 11:06:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705921571; cv=none; b=KbhVNuO+FcKtHczjMqQBaJzYy75mhNWPltY6SKQI9rncK8P4ow+tgE7kCJuUKSQaGA/xhOLrxhTFH0GQg/Ma06seqkz0EWMtrvPYZfBrVHbRv42fa5V0pz6GI4H278zP4XLc1/Ix/9vPUF/imPLkh1Ll1L7m1DMu0iX1A+ZAceM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705921571; c=relaxed/simple; bh=V/MmW1yVoK0TjvFsg0TJRYR3IjhkDr66kgUMy4s5icQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dvcnf1pF4l77Sqj6ZNXFA4DxtlwbXEKdUgirGkxng48oV2DZ7+TJMmKncGJVFb5EukEqa2xLluY/ztj47MH/6VFro1hbhQyAvPPdxAjDDleLOntZNMOH9EQp+2WTYZt7an2HpEqN1qtxhdI4hnZITZsU4FFnHcMlYFskgglijVo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sT8RYILN; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C865C433C7; Mon, 22 Jan 2024 11:06:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705921570; bh=V/MmW1yVoK0TjvFsg0TJRYR3IjhkDr66kgUMy4s5icQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sT8RYILNkg7DURq+DonPfOgYKWZzT9z1t7mKh5x8C8ZtDBgG2Ac0So6ocPeViznQk +b371knvzEQWiydLKI1rfHATW4gAcoP59HbiRavhYPxlUmUDhWQYFGir8/FVGINZd4 4pbOy4f0jZXJrLq+pJ3U/hqDcEQirBEh7ORQTHlbVbDWuK1Bz5xSiDRJ61ytOBjCy+ MIKGPKdVLBk54rOk1kK1ZfjKmuXIlY6qfkGds5xNN06kmh+7o/uJaxX7pptL30KyeJ KtePRH0INjn0SKiK3esQsx8GBl9w/Z8ZG+lbA3GAdrOUfJSnUjJhBs97oG+pTIzNU4 jhoAF4LEG4IIA== Date: Mon, 22 Jan 2024 16:36:06 +0530 From: Vinod Koul To: Paul Cercueil Cc: Jonathan Cameron , Lars-Peter Clausen , Sumit Semwal , Christian =?iso-8859-1?Q?K=F6nig?= , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, linux-iio@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, Nuno =?iso-8859-1?Q?S=E1?= , Michael Hennerich Subject: Re: [Linaro-mm-sig] Re: [PATCH v5 3/8] dmaengine: Add API function dmaengine_prep_slave_dma_vec() Message-ID: References: <20231219175009.65482-1-paul@crapouillou.net> <20231219175009.65482-4-paul@crapouillou.net> <86a30af0db2232bd473a38cd001342156cd4012e.camel@crapouillou.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <86a30af0db2232bd473a38cd001342156cd4012e.camel@crapouillou.net> Hi Paul, On 08-01-24, 13:20, Paul Cercueil wrote: > Hi Vinod, > > Le jeudi 21 d?cembre 2023 ? 20:44 +0530, Vinod Koul a ?crit?: > > On 19-12-23, 18:50, Paul Cercueil wrote: > > > This function can be used to initiate a scatter-gather DMA > > > transfer, > > > where the address and size of each segment is located in one entry > > > of > > > the dma_vec array. > > > > > > The major difference with dmaengine_prep_slave_sg() is that it > > > supports > > > specifying the lengths of each DMA transfer; as trying to override > > > the > > > length of the transfer with dmaengine_prep_slave_sg() is a very > > > tedious > > > process. The introduction of a new API function is also justified > > > by the > > > fact that scatterlists are on their way out. > > > > > > Note that dmaengine_prep_interleaved_dma() is not helpful either in > > > that > > > case, as it assumes that the address of each segment will be higher > > > than > > > the one of the previous segment, which we just cannot guarantee in > > > case > > > of a scatter-gather transfer. > > > > > > Signed-off-by: Paul Cercueil > > > > > > --- > > > v3: New patch > > > > > > v5: Replace with function dmaengine_prep_slave_dma_vec(), and > > > struct > > > ??? 'dma_vec'. > > > ??? Note that at some point we will need to support cyclic > > > transfers > > > ??? using dmaengine_prep_slave_dma_vec(). Maybe with a new "flags" > > > ??? parameter to the function? > > > --- > > > ?include/linux/dmaengine.h | 25 +++++++++++++++++++++++++ > > > ?1 file changed, 25 insertions(+) > > > > > > diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h > > > index 3df70d6131c8..ee5931ddb42f 100644 > > > --- a/include/linux/dmaengine.h > > > +++ b/include/linux/dmaengine.h > > > @@ -160,6 +160,16 @@ struct dma_interleaved_template { > > > ? struct data_chunk sgl[]; > > > ?}; > > > ? > > > +/** > > > + * struct dma_vec - DMA vector > > > + * @addr: Bus address of the start of the vector > > > + * @len: Length in bytes of the DMA vector > > > + */ > > > +struct dma_vec { > > > + dma_addr_t addr; > > > + size_t len; > > > +}; > > I don't want to be pushy, but I'd like to know how to solve this now, > otherwise I'll just send the same patches for my v6. > > > so you want to transfer multiple buffers, right? why not use > > dmaengine_prep_slave_sg(). If there is reason for not using that one? > > The reason is that we want to have the possibility to transfer less > than the total size of the scatterlist, and that's currently very hard > to do - scatterlists were designed to not be tampered with. > > Christian K?nig then suggested to introduce a "dma_vec" which had been > on his TODO list for a while now. Yeah for this interleaved seems overkill. Lets go with this api. I would suggest change the name of the API replacing slave with peripheral though -- ~Vinod