linux/drivers/base/regmap
Andy Shevchenko 09e70e4f11
regmap: Synchronize cache for the page selector
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: 6863ca6227 ("regmap: Add support for register indirect addressing.")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20260302184753.2693803-1-andriy.shevchenko@linux.intel.com
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-16 13:50:34 +00:00
..
Kconfig regmap: Enable REGMAP when REGMAP_SLIMBUS is enabled 2026-01-15 18:58:29 +00:00
Makefile regmap: Provide a ram backed regmap with raw support 2023-06-12 14:47:54 +01:00
internal.h regmap: Add reg_default_cb callback for flat cache defaults 2026-01-27 12:46:10 +00:00
regcache-flat.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
regcache-maple.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
regcache-rbtree.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
regcache.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
regmap-ac97.c regmap: add missing MODULE_DESCRIPTION() macros 2024-06-24 13:38:40 +01:00
regmap-debugfs.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
regmap-fsi.c regmap: Add FSI bus support 2022-11-25 19:17:02 +00:00
regmap-i2c.c regmap-i2c: add missing MODULE_DESCRIPTION() macro 2024-06-14 15:23:14 +01:00
regmap-i3c.c I3C for 6.19 2025-12-08 11:25:14 +09:00
regmap-irq.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
regmap-kunit.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
regmap-mdio.c regmap: Drop capitalisation in MODULE_DESCRIPTION() 2024-04-10 22:45:52 +01:00
regmap-mmio.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
regmap-ram.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
regmap-raw-ram.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
regmap-sccb.c regmap: add missing MODULE_DESCRIPTION() macros 2024-06-24 13:38:40 +01:00
regmap-sdw-mbq.c regmap: Updates for v6.19 2025-12-04 11:16:44 -08:00
regmap-sdw.c regmap: Drop capitalisation in MODULE_DESCRIPTION() 2024-04-10 22:45:52 +01:00
regmap-slimbus.c regmap: slimbus: fix bus_context pointer in regmap init calls 2025-10-23 15:19:58 +01:00
regmap-spi-avmm.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
regmap-spi.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
regmap-spmi.c regmap: add missing MODULE_DESCRIPTION() macros 2024-06-24 13:38:40 +01:00
regmap-w1.c regmap: add missing MODULE_DESCRIPTION() macros 2024-06-24 13:38:40 +01:00
regmap.c regmap: Synchronize cache for the page selector 2026-03-16 13:50:34 +00:00
trace.h tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00