Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754938AbbGPOPG (ORCPT ); Thu, 16 Jul 2015 10:15:06 -0400 Received: from down.free-electrons.com ([37.187.137.238]:50478 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752451AbbGPOPE (ORCPT ); Thu, 16 Jul 2015 10:15:04 -0400 Date: Thu, 16 Jul 2015 16:11:05 +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: <20150716141105.GJ28632@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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MgcI0aUO3vrRQI/Z" Content-Disposition: inline In-Reply-To: <20150716120154.GN5086@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: 2959 Lines: 79 --MgcI0aUO3vrRQI/Z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Vinod, > > + /* > > + * 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. Ideally > you should take the scatterlist and program the lli for controller. 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. 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. Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com --MgcI0aUO3vrRQI/Z Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVp7t5AAoJEBx+YmzsjxAglloQAL/4OpjRnbmZjnxHO/81ZKn4 ksEZ6erNAVTcE/tpZW54WZd/s1L5pOt+ZToHjYQnFjAgHbCpXKxASxK/nohYzwfv FgSnP6FwTS85E7qVi/ixoQMuW70sPRkR6B5jA71EjyvjfSUy2hWiFXSae2q4ajO7 iAYeTgaqboOEYNYknVI7II7Iz4EWIWb4huq85RUbXsAVGYne8n+4bTyoU8uZWVGc 9VakPKfp8Ryf5pU1YOiq77fZ3/lMD31x5iqe7I5Iypq2RvRtB2Nz4c+diAX+CP2i wOKgRaBVE1dgLe9n7a4YmAsVmUkp5w6fOSGN+sw51kvWAX6NNevLgGNmU+Z7pU4c R0NRJ4hvHK0HYhX4nxcCrGW7uk8hEKrkqHEpbdSFniTeYGrhzV3DKCT8lOpLpVVq X9uJiiMeLBIPFP9NeX7RbGfeHQbSpn2wmLE+WK4ohLDYq8F5mJQLYwjIGt/zHulU MCqnnk0BiqQx35rWW8cBk67ktZq11vwevcz5X4XTolyj7tsYevQugWlyj4zhYZOc juap7GaSYnLS6o+WxZXwbGGsNKfA/E9eZ07i5L5x3BfcjOkRY8a2xMPpHURl7uf3 eouAo6J/Y5db5HGwWgLrtp8jgaL8zeR0V5p9tax7yA/MgCx2syAhjOQsg8B+6vED FACTQMDCjKBoMfWhqowB =M6Dl -----END PGP SIGNATURE----- --MgcI0aUO3vrRQI/Z-- -- 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/