Messages in this thread Patch in this message |  | | From | Mark Brown <> | | Subject | [PATCH 1/2] regmap: Bypass the cache when applying patches | | Date | Wed, 25 Jan 2012 21:07:19 +0000 |
| |
Otherwise any patch that affects a register which is writable may trash cached values.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> --- drivers/base/regmap/regcache.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c index 0d54668..bfe48e4 100644 --- a/drivers/base/regmap/regcache.c +++ b/drivers/base/regmap/regcache.c @@ -268,6 +268,7 @@ int regcache_sync(struct regmap *map) trace_regcache_sync(map->dev, name, "start"); /* Apply any patch first */ + map->cache_bypass = 1; for (i = 0; i < map->patch_regs; i++) { ret = _regmap_write(map, map->patch[i].reg, map->patch[i].def); if (ret != 0) { @@ -276,6 +277,7 @@ int regcache_sync(struct regmap *map) goto out; } } + map->cache_bypass = 0; if (!map->cache_dirty) goto out; -- 1.7.9.rc1
|  |