Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regmap: Hold the regmap lock when allocating and freeing the cache

For the benefit of the maple tree's lockdep checking hold the lock while
creating and exiting the cache.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/20240822-b4-regmap-maple-nolock-v1-2-d5e6dbae3396@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>

+5
+4
drivers/base/regmap/regcache.c
··· 195 195 if (map->cache_ops->init) { 196 196 dev_dbg(map->dev, "Initializing %s cache\n", 197 197 map->cache_ops->name); 198 + map->lock(map->lock_arg); 198 199 ret = map->cache_ops->init(map); 200 + map->unlock(map->lock_arg); 199 201 if (ret) 200 202 goto err_free; 201 203 } ··· 225 223 if (map->cache_ops->exit) { 226 224 dev_dbg(map->dev, "Destroying %s cache\n", 227 225 map->cache_ops->name); 226 + map->lock(map->lock_arg); 228 227 map->cache_ops->exit(map); 228 + map->unlock(map->lock_arg); 229 229 } 230 230 } 231 231
+1
drivers/base/regmap/regmap.c
··· 1445 1445 struct regmap_async *async; 1446 1446 1447 1447 regcache_exit(map); 1448 + 1448 1449 regmap_debugfs_exit(map); 1449 1450 regmap_range_exit(map); 1450 1451 if (map->bus && map->bus->free_context)