From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757214AbcASRlk (ORCPT ); Tue, 19 Jan 2016 12:41:40 -0500 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:34139 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755254AbcASRlc (ORCPT ); Tue, 19 Jan 2016 12:41:32 -0500 Date: Tue, 19 Jan 2016 17:41:20 +0000 From: Mark Brown To: Stefan Agner Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Message-ID: <20160119174120.GR6588@sirena.org.uk> References: <1453099976-9016-1-git-send-email-stefan@agner.ch> <20160118160557.GG6588@sirena.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lZl9LXaXBWDq3P64" Content-Disposition: inline In-Reply-To: X-Cookie: APL hackers do it in the quad. User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: 2a01:348:6:8808:fab::3 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [RFC] regmap: clairify max_register meaning X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --lZl9LXaXBWDq3P64 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 18, 2016 at 09:19:52AM -0800, Stefan Agner wrote: > On 2016-01-18 08:05, Mark Brown wrote: > >> Maybe I see something completely wrong here, but to me it seems > >> that the regcache-flat.c is the only code interpreting max_register > >> as register indexes rather then the maximum relative address... > > I don't think I understand what the above means, sorry. What is a > > "relative address" in the context of a register map? > My interpretation: > relative address =3D index * stride > absolute address =3D base address + relative address Oh, OK. I would have got that for absolute address for MMIO but definitely not relative address. For relative addresses I'd interpret index and address as synonyms. > > Your changelog doesn't actually say this but I think what this is trying > > to do is make the cache more memory efficient by not allocating space > > for the registers that don't exist due to striding (ie, if we have a 4 > > byte stride then currently we'll allocate space for 4 times as many > > registers as actually exist). That's a reasonable goal but I don't > > immediately have a good idea for doing it bearing in mind that we are > > very performance sensitive here. > Yeah I saw a bug in that, but I see that this is actually just a not > very space efficient implementation detail. Indeed. It is true that having that 300% overhead in a common case is a bit annoying so if you do have any ideas for fixing that without taking a performance hit that'd be really good. > >> - * @max_register: Optional, specifies the maximum valid register inde= x. > >> + * @max_register: Optional, specifies the maximum valid register addr= ess. > > This is reasonable (index and address are synonyms here). >=20 > Ok, in that case I clearly interpreted index wrong. > Btw, range_min and range_max in struct regmap_range_cfg are defined as > memory addresses: > ... > * @range_min: Address of the lowest register address in virtual range.= =20 > =20 > * @range_max: Address of the highest register in virtual range. > ... Not memory addresses, register addresses. Remember that most regmap register maps are not memory mapped at all but rather are completely separate ranges on some external device (especially things using ranges, you're normally not short enough on addresses on a memory mapped device to bother with a window) so when looking at memory mapped devices it's best to think only of the area that's actually mapped into the regmap. > Will send out a patch for the documentation change only, if you think > that this is a reasonable change too? Yes, please do. --lZl9LXaXBWDq3P64 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJWnnU/AAoJECTWi3JdVIfQHlEH/RHq7igU+7cZkJtSdltZYBHo mwGWy5lKTJJu+doAqZywraa1eYAg1Qdku6voY90NcOuryyN8bLphvDj6Ad7pdBN5 NEtLuK1bdIeg1oKkhk8+Z1q+Ul5nv5NAwFZk16jJ/8hreKDezcI//cfEgaGcj8/K PqepTEC9ENQH84flmsPYJTLTwfh+wrctBUCW7V85Wu7gOwI4IZA63HnFd266Wci9 MkOEPQRUyfcSglQS51G0tqQeq+jm+g6Z+ymHFwqYBlQN3R18WxKNuTi3p7pPWrzM bopIlbiwAlb498ALt4Eu08n7dKIAKWVMK+3CJadS1IbBnV2opOeHH4UAzWOotOQ= =rLLl -----END PGP SIGNATURE----- --lZl9LXaXBWDq3P64--