lkml.org 
[lkml]   [2022]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v1 5/5] regmap: mmio: Introduce IO accessors that can talk to IO port
On Mon, Aug 8, 2022 at 3:31 PM Mark Brown <broonie@kernel.org> wrote:
> On Fri, Aug 05, 2022 at 11:53:21PM +0300, Andy Shevchenko wrote:
>
> > Currently regmap MMIO is inconsistent with IO accessors. I.e.
> > the Big Endian counterparts are using ioreadXXbe() / iowriteXXbe()
> > which are not clean implementations of readXXbe(). Besides that
> > some users may use regmap MMIO for IO ports, and this can be done
> > by assigning ioreadXX()/iowriteXX() and their Big Endian counterparts
> > to the regmap context.
>
> Have you validated that nothing is relying on whatever the problem is
> with using the io versions?

I have cross-checked 1) the architectures that are BE and have IO port
capability, and 2) the drivers that are using regmap MMIO with a
big-endian setting. I found no driver is mapping IO ports and uses
regmap MMIO at the same time. The architecture wise the x86 and ia64
are not in question, I think. And alpha is more academical nowadays.
Did I miss anything?

That said, I'm 99.999% sure there is no problem with that.

...

> > That said, reimplement current Big Endian MMIO accessors by replacing
> > ioread()/iowrite() with respective read()/write() and swab() calls.
> > While at it, add IO port support with a corresponding flag added.
>
> This should be a separate patch.

OK! Then we remove some code and (re-)add it later. Do we need this churn?
Another way is to add IO port accessors and then fix the MMIO.

...

> > + if (config->io_port) {
> > + ctx->reg_read = regmap_mmio_ioread8;
> > + ctx->reg_write = regmap_mmio_iowrite8;
> > + } else if (config->use_relaxed_mmio) {
>
> If these options are mutually exclusive we should validate that they are
> not simultaneously set.

Yes, the validation is missed. I will add it.

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2022-08-08 16:41    [W:0.110 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site