[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230330114546.13472135@pc-7.home>
Date: Thu, 30 Mar 2023 11:45:46 +0200
From: Maxime Chevallier <maxime.chevallier@...tlin.com>
To: Mark Brown <broonie@...nel.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>, rafael@...nel.org,
Colin Foster <colin.foster@...advantage.com>,
Vladimir Oltean <vladimir.oltean@....com>,
Lee Jones <lee@...nel.org>, davem@...emloft.net,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
thomas.petazzoni@...tlin.com
Subject: Re: [RFC 2/7] regmap: check for alignment on translated register
addresses
Hello Mark,
On Fri, 24 Mar 2023 18:51:19 +0000
Mark Brown <broonie@...nel.org> wrote:
> On Fri, Mar 24, 2023 at 10:36:39AM +0100, Maxime Chevallier wrote:
> > With regmap->reg_base and regmap->reg_downshift, the actual register
> > address that is going to be used for the next operation might not
> > be the same as the one we have as an input. Addresses can be offset
> > with reg_base and shifted, which will affect alignment.
> >
> > Check for alignment on the real register address.
>
> It is not at all clear to me that the combination of stride and
> downshift particularly makes sense, and especially not that the
> stride should be applied after downshifting rather than to what
> the user is passing in.
I agree on the part where the ordering of "adding and offset, then
down/upshifting" isn't natural. This is the order in which operations
are done today, and from what I could gather, only the ocelot-spi MFD
driver uses both of these operations.
It would indeed make sense to first shift the register to have the
proper spacing between register addresses, then adding the offset.
So maybe we should address that in ocelot-spi in the next iteration,
Colin, would you agree ?
Thanks,
Maxime
Powered by blists - more mailing lists