Re: [PATCH] regmap: don't check for alignment when using reg_shift

From: Colin Foster
Date: Fri May 05 2023 - 13:19:40 EST


Hi Maxime,

On Fri, Apr 28, 2023 at 09:47:45AM +0200, Maxime Chevallier wrote:
> On Fri, 28 Apr 2023 09:30:10 +0200
> Maxime Chevallier <maxime.chevallier@xxxxxxxxxxx> wrote:
>
> > Hello Mark, Colin,
> >
> > On Tue, 25 Apr 2023 13:56:23 +0100
> > Mark Brown <broonie@xxxxxxxxxx> wrote:
> >
> > > On Fri, Apr 21, 2023 at 08:50:30AM -0700, Colin Foster wrote:
> > > > On Thu, Apr 20, 2023 at 05:06:17PM +0200, Maxime Chevallier
> > > > wrote:
> > >
> > > > > On regmap consumers that require address translation through
> > > > > up/downshifting, the alignment check in the regmap core doesn't
> > > > > take the translation into account. This doesn't matter when
> > > > > downshifting the register address, as any address that fits a
> > > > > given alignment requirement will still meet it when downshifted
> > > > > (a 4-byte aligned address will always also be 2-bytes aligned
> > > > > for example).
> > >
> > > > > However, when upshifting, this check causes spurious errors, as
> > > > > it occurs before the upshifting.
> > >

Sorry for a really delayed response, but I just got back around to
thinking about this. Crazy busy times for me.

What about an explicit parameter in regmap_config that will disable
alignment checks? That seems like it might be a welcome feature
addition.


Colin Foster