Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754589AbbGUMUF (ORCPT ); Tue, 21 Jul 2015 08:20:05 -0400 Received: from down.free-electrons.com ([37.187.137.238]:51745 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752345AbbGUMUD (ORCPT ); Tue, 21 Jul 2015 08:20:03 -0400 Date: Tue, 21 Jul 2015 14:19:00 +0200 From: Maxime Ripard To: Vinod Koul Cc: Nicolas Ferre , Alexandre Belloni , Ludovic Desroches , Thomas Petazzoni , Boris Brezillon , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 2/2] dmaengine: xdmac: Add scatter gathered memset support Message-ID: <20150721121900.GB2373@lukather> References: <1436177964-19380-1-git-send-email-maxime.ripard@free-electrons.com> <1436177964-19380-3-git-send-email-maxime.ripard@free-electrons.com> <20150716120154.GN5086@localhost> <20150716141105.GJ28632@lukather> <20150717030926.GC5086@localhost> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zx4FCpZtqtKETZ7O" Content-Disposition: inline In-Reply-To: <20150717030926.GC5086@localhost> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3787 Lines: 94 --zx4FCpZtqtKETZ7O Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 17, 2015 at 08:39:26AM +0530, Vinod Koul wrote: > On Thu, Jul 16, 2015 at 04:11:05PM +0200, Maxime Ripard wrote: > > Hi Vinod, > >=20 > > > > + /* > > > > + * The scatterlist API gives us only the address and > > > > + * length of each elements. > > > > + * > > > > + * Unfortunately, we don't have the stride, which we > > > > + * will need to compute. > > > > + * > > > > + * That make us end up in a situation like this one: > > > > + * len stride len stride len > > > > + * +-------+ +-------+ +-------+ > > > > + * | N-2 | | N-1 | | N | > > > > + * +-------+ +-------+ +-------+ > > > > + * > > > > + * We need all these three elements (N-2, N-1 and N) > > > > + * to actually take the decision on whether we need to > > > > + * queue N-1 or reuse N-2. > > > > + * > > > > + * We will only consider N if it is the last element. > > > > + */ > > > > > > Why do you need stride? > > >=20 > > > This is scatterlist so the computation of stride sounds odd here. Ide= ally > > > you should take the scatterlist and program the lli for controller. > >=20 > > Because it is sub-optimal if the length and stride are equals from one > > descriptors to another. The XDMAC is able to repeat any given > > descriptor a given number of time (which is one by default), which > > means that if the parameters of the transfer don't change, we simply > > have to increment the number of time the descriptor has to be used, > > instead of creating a new one that the controller will have to fetch. > >=20 > > In the non-optimal case (ie the length and/or stride change from one > > scatterlist element to another), we simply fallback to a one LLI per > > scatter list element. > > Sound fine to me. The optimization is a good one then... >=20 > Another question though, do you expect stride to be linear for your > cases, if so have you actually though about using interleaved API, > for these cases What do you mean by linear? I guess, at least from an API point of view, we should expect any stride and length. The scatter gather variants of the dmaengine API were already using scatterlist, and the interleaved template doesn't really fit our use case here, so I chose to use a scatterlist here, mostly for consistency. Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com --zx4FCpZtqtKETZ7O Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVrji0AAoJEBx+YmzsjxAgx04QAIRYP99UuPrgk6BupaNDzLtX DPLzo5qkqeLGzEFKZXdZo9nrQ+uDoiGcJr/Yw1L6sTv3KXucs0vATKu6KLvq/yDI jL63WCD1+mGTEFtclqTrr8DEXkNiUzkw1ByBY+ObdccygZUMO90o04GQGvUA5D3B 9eI91Uv2JdH2hfpXu/4K+F7e0BhalMZf8EwKAJHCE5joYKHjJF4Nj77SfcFtCJ7A 8CjcPo0N37BaFixJ/HBuPHzGSPexr6olMFtwXP8cFl9EHLGHqWlD7EqCfb+ORbdY rvPyZHisKepVHo83Gc+H3hWJU/x/aV40E/AJQvHEU//CkOsqar6UjB0t1hOt95PY YH44m4NuGYCwCQQNPHxSzm5LWpo0+zkcXXQbdiygFKnF7rJLBeqNpsE2Na3hw+j6 QhHtuLd4wPHUSuSwu1FqwgemSfxue15Z9tI21/ukkwNN51N2szE8txn2ggU/tBbk vrZ5MUwmm16gPDewF1rYh9dapI8zWqSdzTOG4mmvIB98c5sj8/glD5PC3LhH26mf aYc6MIJ5++zaytkmIErWMVU8pswfRKVvmr+M5cQ20l6QrjCUp5QkBXs3MknTzwyh n2jYCISEiipzsY6QNx9KXdLsE9n/2HzvSwEbJnCNByEXDhexDiwUR42Hr1eWz9oJ dh/F5G+RBW+R+cZgu/7G =cjWl -----END PGP SIGNATURE----- --zx4FCpZtqtKETZ7O-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/