Skip to contentSkip to conversation

regmap: cache: set max_register with reg_stride

PATCH In review Jeongtae Park 2 participants 2 messages Apr 25, 2022 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CGME20220425114955epcas2p331be3ef61616c06974e3e9c6448e6394@epcas2p3.samsung.com

#1 lore raw

PATCH 1/1 regmap: cache: set max_register with reg_stride

Current logic does not consider multi-stride cases, the max_register have to calculate with reg_stride because it is a kind of address range.

---
 drivers/base/regmap/regcache.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/base/regmap/regcache.c +2 -2
index f2469d3435ca..d0f5bc827978 100644
@@ -183,8 +183,8 @@ int regcache_init(struct regmap *map, const struct regmap_config *config)
 			return 0;
 	}
 
-	if (!map->max_register)
-		map->max_register = map->num_reg_defaults_raw;
+	if (!map->max_register && map->num_reg_defaults_raw)
+		map->max_register = (map->num_reg_defaults_raw  - 1) * map->reg_stride;
 
 	if (map->cache_ops->init) {
 		dev_dbg(map->dev, "Initializing %s cache\n",
Signature · 1 line
2.25.1
maintainer
#2 lore raw
Quoted 5 lines · Jeongtae Park

Current logic does not consider multi-stride cases, the max_register have to calculate with reg_stride because it is a kind of address range.

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git for-next

Thanks!

[1/1] regmap: cache: set max_register with reg_stride

      commit: d640947562cea6158df13fe021b0e117865ba8b3

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark