regmap: Lock the sync path, ensure we use the lockless _regmap_write()
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:

committed by
Mark Brown

parent
5fcd256076
commit
13753a9088
@@ -230,6 +230,7 @@ int regcache_sync(struct regmap *map)
|
||||
|
||||
BUG_ON(!map->cache_ops);
|
||||
|
||||
mutex_lock(&map->lock);
|
||||
dev_dbg(map->dev, "Syncing %s cache\n",
|
||||
map->cache_ops->name);
|
||||
name = map->cache_ops->name;
|
||||
@@ -242,7 +243,7 @@ int regcache_sync(struct regmap *map)
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
map->cache_bypass = 1;
|
||||
ret = regmap_write(map, i, val);
|
||||
ret = _regmap_write(map, i, val);
|
||||
map->cache_bypass = 0;
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
@@ -254,6 +255,7 @@ int regcache_sync(struct regmap *map)
|
||||
}
|
||||
out:
|
||||
trace_regcache_sync(map->dev, name, "stop");
|
||||
mutex_unlock(&map->lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user