Re: [PATCH v5 1/1] regmap: Synchronize cache for the page selector

From: Andy Shevchenko

Date: Wed Mar 11 2026 - 17:52:14 EST


On Mon, Mar 02, 2026 at 08:03:11PM +0100, Marek Szyprowski wrote:
> On 02.03.2026 19:43, Andy Shevchenko wrote:
> > If the selector register is represented in each page, its value
> > according to the debugfs is stale because it gets synchronized
> > only after the real page switch happens. Hence the regmap cache
> > initialisation from the HW inherits outdated data in the selector
> > register.
> >
> > Synchronize cache for the page selector just in time.
> >
> > Before (offset followed by hexdump, the first byte is selector):
> >
> > // Real registers
> > 18: 05 ff 00 00 ff 0f 00 00 f0 00 00 00
> > ...
> > // Virtual (per port)
> > 40: 05 ff 00 00 e0 e0 00 00 00 00 00 1f
> > 50: 00 ff 00 00 e0 e0 00 00 00 00 00 1f
> > 60: 01 ff 00 00 ff ff 00 00 00 00 00 00
> > 70: 02 ff 00 00 cf f3 00 00 00 00 00 0c
> > 80: 03 ff 00 00 00 00 00 00 00 00 00 ff
> > 90: 04 ff 00 00 ff 0f 00 00 f0 00 00 00
> >
> > After:
> >
> > // Real registers
> > 18: 05 ff 00 00 ff 0f 00 00 f0 00 00 00
> > ...
> > // Virtual (per port)
> > 40: 00 ff 00 00 e0 e0 00 00 00 00 00 1f
> > 50: 01 ff 00 00 e0 e0 00 00 00 00 00 1f
> > 60: 02 ff 00 00 ff ff 00 00 00 00 00 00
> > 70: 03 ff 00 00 cf f3 00 00 00 00 00 0c
> > 80: 04 ff 00 00 00 00 00 00 00 00 00 ff
> > 90: 05 ff 00 00 ff 0f 00 00 f0 00 00 00
> >
> > Fixes: 6863ca622759 ("regmap: Add support for register indirect addressing.")
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

> Tested-by: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>

Thank you!

Not sure if Dmitry will be able to test this, he didn't react to this message,
but at least the Marek's case is confirmed to working. Can we take this in?

Dmitry, would you be able to test this change?

--
With Best Regards,
Andy Shevchenko