Skip to content

RFC regmap: Add flat_cache_default_is_zero flag for flat cache

Sheetal . linux-sound linux-tegra lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest3 patches 5 repliesIn review
  2. v1 RFC2 patches 5 repliesSuperseded

Changes in v2 from the cover letter

- Renamed flag from cache_default_is_zero to flat_cache_default_is_zero to make it explicit that this is specific to REGCACHE_FLAT
- Added KUnit test coverage (patch 2/3)
- Updated commit message to explain why valid bits are set on first read rather than at init time

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3regmap: Add flat_cache_default_is_zero flag for flat cachedrivers/base/regmap/internal.h drivers/base/regmap/regcache-flat.c drivers/base/regmap/regcache.c +1 more+12 -42 replies
2/3regmap: Add KUnit test for flat_cache_default_is_zerodrivers/base/regmap/regmap-kunit.c+87 -00 replies
3/3ASoC: tegra: Enable flat_cache_default_is_zero for audio driverssound/soc/tegra/tegra186_asrc.c sound/soc/tegra/tegra186_dspk.c sound/soc/tegra/tegra210_admaif.c +11 more+234 -2123 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [RFC PATCH v2 0/3] regmap: Add flat_cache_default_is_zero flag for flat cache

From: Sheetal <[email protected]>

This patch series adds a flat_cache_default_is_zero flag for REGCACHE_FLAT that marks cache entries as valid on first read.

For hardware with zero power-on-reset registers, this avoids the need to add all such registers to reg_defaults (maintenance burden, code bloat, no functional benefit) just to set the validity bits.

By setting valid bits on read rather than at init, only accessed registers are marked valid. This keeps regcache_sync scope minimal and avoids writes to unused registers or holes.

Changes in v2:
- Renamed flag from cache_default_is_zero to flat_cache_default_is_zero to make it explicit that this is specific to REGCACHE_FLAT
- Added KUnit test coverage (patch 2/3)
- Updated commit message to explain why valid bits are set on first read rather than at init time

Sheetal (3):
regmap: Add flat_cache_default_is_zero flag for flat cache
regmap: Add KUnit test for flat_cache_default_is_zero
ASoC: tegra: Enable flat_cache_default_is_zero for audio drivers

 drivers/base/regmap/internal.h      |  2 ++
 drivers/base/regmap/regcache-flat.c | 12 ++++++++----
 drivers/base/regmap/regcache.c      |  1 +
 drivers/base/regmap/regmap-kunit.c  | 93 ++++++++++++++++++++++++++++++
 include/linux/regmap.h              |  1 +
 sound/soc/tegra/tegra186_asrc.c     |  1 +
 sound/soc/tegra/tegra186_dspk.c     |  1 +
 sound/soc/tegra/tegra210_admaif.c   |  3 +++
 sound/soc/tegra/tegra210_adx.c      |  2 ++
 sound/soc/tegra/tegra210_ahub.c     |  3 +++
 sound/soc/tegra/tegra210_amx.c      |  3 +++
 sound/soc/tegra/tegra210_dmic.c     |  1 +
 sound/soc/tegra/tegra210_i2s.c      |  2 ++
 sound/soc/tegra/tegra210_mbdrc.c    |  1 +
 sound/soc/tegra/tegra210_mixer.c    |  1 +
 sound/soc/tegra/tegra210_mvc.c      |  1 +
 sound/soc/tegra/tegra210_ope.c      |  1 +
 sound/soc/tegra/tegra210_peq.c      |  1 +
 sound/soc/tegra/tegra210_sfc.c      |  1 +
 19 files changed, 127 insertions(+), 4 deletions(-)
Signature · 1 line
2.34.1