提交 4d879514 编写于 作者: D Dimitris Papastamos 提交者: Mark Brown

regmap: Don't lock in regmap_reinit_cache()

When bus->fast_io is set, the locking here is done with spinlocks.
This is currently true for the regmap-mmio bus implementation.

While holding a spinlock we can't go to sleep, various operations
like removing the debugfs entries or re-initializing the cache will
sleep, therefore, shift the locking up to the user.
Signed-off-by: NDimitris Papastamos <dp@opensource.wolfsonmicro.com>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 0d7614f0
...@@ -659,13 +659,12 @@ EXPORT_SYMBOL_GPL(devm_regmap_init); ...@@ -659,13 +659,12 @@ EXPORT_SYMBOL_GPL(devm_regmap_init);
* new cache. This can be used to restore the cache to defaults or to * new cache. This can be used to restore the cache to defaults or to
* update the cache configuration to reflect runtime discovery of the * update the cache configuration to reflect runtime discovery of the
* hardware. * hardware.
*
* No explicit locking is done here, the user needs to ensure that
* this function will not race with other calls to regmap.
*/ */
int regmap_reinit_cache(struct regmap *map, const struct regmap_config *config) int regmap_reinit_cache(struct regmap *map, const struct regmap_config *config)
{ {
int ret;
map->lock(map);
regcache_exit(map); regcache_exit(map);
regmap_debugfs_exit(map); regmap_debugfs_exit(map);
...@@ -681,11 +680,7 @@ int regmap_reinit_cache(struct regmap *map, const struct regmap_config *config) ...@@ -681,11 +680,7 @@ int regmap_reinit_cache(struct regmap *map, const struct regmap_config *config)
map->cache_bypass = false; map->cache_bypass = false;
map->cache_only = false; map->cache_only = false;
ret = regcache_init(map, config); return regcache_init(map, config);
map->unlock(map);
return ret;
} }
EXPORT_SYMBOL_GPL(regmap_reinit_cache); EXPORT_SYMBOL_GPL(regmap_reinit_cache);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册