Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751888AbcCKLOR (ORCPT ); Fri, 11 Mar 2016 06:14:17 -0500 Received: from mga04.intel.com ([192.55.52.120]:14404 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751534AbcCKLON (ORCPT ); Fri, 11 Mar 2016 06:14:13 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,320,1455004800"; d="asc'?scan'208";a="64212700" Date: Fri, 11 Mar 2016 16:48:26 +0530 From: Vinod Koul To: Maxime Ripard Cc: Boris Brezillon , Dan Williams , dmaengine@vger.kernel.org, Chen-Yu Tsai , linux-sunxi@googlegroups.com, Emilio =?iso-8859-1?Q?L=F3pez?= , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users Message-ID: <20160311111825.GC11154@localhost> References: <1457344771-12946-1-git-send-email-boris.brezillon@free-electrons.com> <20160307145429.GG11154@localhost> <20160307160857.577bb04d@bbrezillon> <20160307203024.GD8418@lukather> <20160308025547.GI11154@localhost> <20160309120627.67612b1d@bbrezillon> <20160311062607.GP11154@localhost> <20160311104552.23e06a16@bbrezillon> <20160311100902.GY11154@localhost> <20160311105549.GZ8418@lukather> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HCdXmnRlPgeNBad2" Content-Disposition: inline In-Reply-To: <20160311105549.GZ8418@lukather> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3787 Lines: 98 --HCdXmnRlPgeNBad2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 11, 2016 at 11:55:49AM +0100, Maxime Ripard wrote: > On Fri, Mar 11, 2016 at 03:39:02PM +0530, Vinod Koul wrote: > > On Fri, Mar 11, 2016 at 10:45:52AM +0100, Boris Brezillon wrote: > > > On Fri, 11 Mar 2016 11:56:07 +0530 > > > Vinod Koul wrote: > > >=20 > > > > On Wed, Mar 09, 2016 at 12:06:27PM +0100, Boris Brezillon wrote: > > > > > On Tue, 8 Mar 2016 08:25:47 +0530 > > > > > Vinod Koul wrote: > > > > > >=20 > > > > > > Why does dmaengine need to wait? Can you explain that > > > > >=20 > > > > > I don't have an answer for that one, but when I set WAIT_CYCLES t= o 1 > > > > > for the NAND use case it does not work. So I guess it is somehow > > > > > related to how the DRQ line is controlled on the device side... > > > >=20 > > > > Is the WAIT cycle different for different usages or same for all > > > > usages/channels? > > > >=20 > > >=20 > > > In Allwinner BSP they adapt it on a per slave device basis, but since > > > DMA channels are dynamically allocated, you can't know in advance whi= ch > > > physical channel will be attached to a specific device. > >=20 > > And we have the correct values availble in datasheet for all usages >=20 > No, we don't. >=20 > If you look at the datasheet in question, page 169. > https://github.com/allwinner-zh/documents/blob/master/A20/A20_User_Manual= _v1.4_20150510.pdf >=20 > This is the only documentation we have. And as you can see, it is very > sparse (and that's an understament). >=20 > So we cannot make that assumption, so far the values have been found > through trial and error for the devices in question. >=20 > > > Another option I considered was adding a new cell to the sun4i DT > > > binding to encode these WAIT_CYCLES and BLOCK_SIZE information. But I= 'm > > > not sure adding that to the DT is a good idea (not to mention that it > > > would break DT ABI again, and given the last discussions on this topi= c, > > > I'm not sure it's a good idea :-/). > >=20 > > Yes i was veering towards DT as well. This is a new property so ABI rul= es > > wont break as long as driver still works with old properties. >=20 > Yeah, we can always default to our current hardcoded value if the > property is missing. And since no-one is using the engine at the > moment anyway, so it's not really a big deal. >=20 > > But this nees to be property for clients and not driver. Client can then > > program these >=20 > Yes, totally. The question here is how the clients give that > information to the driver. For this part am not worried. If we can generalize this then we add to dma_slave_config. Otherwise an exported symbol from driver should be fine. --=20 ~Vinod --HCdXmnRlPgeNBad2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJW4qmBAAoJEHwUBw8lI4NH6oMQAMLPdmXUPJRDZaTcx5oplFa4 Bofv0N4otRVyXI0rJltefmypVSI16TgJZ47yMOH/pqdkg76T1UD0f505qX6cQlTc YPjX/ARM4NuxfghtvB7u1T7vFmgtiMS2BE2+EjSpM7vOtw0sPb80cpSXEwYM/Ouh wzjqjblgkGNn4aR/HYDuzwDQiH45q4UW4RIeUNJG/7ai+Lr9NdtSQcPJJ8/j7IH6 bM3fTAOazxDCzTkPQoOaQ6Fy7891bEvwMpQ+NYL+SjPgYfVn8UqaHLTTrur0AT/7 UiU39Nkksm0OvcmbUPRuMJEnGC8CUcrBWHWblSvhoeOx0LiSKWfEqFH5yXA3f1i7 x7dH8UQ5So0hZRuem/RNOArNntbEDmnX/BCuKbpDAhPAUyYLv+C9Gi4hlPc+H1n2 s4KBdoNGz92qALL7TpjytV2lHWMoCY0n2qWvezBiCNVgKF3sMnQzxzhjsVwPMqJp zlrjNN29g2StqKwFzCx64F/UdJujYt7TNQBMMAcVhnmqFaO9N3SKtWxxYdm+hJ4Y EtrIuKF7P+BFhN9B4oIFzv+S4iQtVUOomOWdUZFAd/VjjTx8g5WMOTxvhfs947Ca aVdPekFKu2DKn7Om7ocLh/bsxIM8U8X1XK7icgdTXUIIqdvns99TR0upx3xbwrfv bcf1KNIbox5vIIMR2kt3 =tqP9 -----END PGP SIGNATURE----- --HCdXmnRlPgeNBad2--