regmap: Bypass the cache when applying patches
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 25 Jan 2012 21:05:48 +0000 (21:05 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 25 Jan 2012 21:22:05 +0000 (21:22 +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

index 9c6a5c13f1daca7c1203a5a1b7e31e7fa98af181..ee36bed9479c923474fca9474654ad6b9134fd28 100644 (file)
@@ -273,6 +273,7 @@ int regcache_sync(struct regmap *map)
                goto out;
 
        /* 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) {
@@ -281,6 +282,7 @@ int regcache_sync(struct regmap *map)
                        goto out;
                }
        }
+       map->cache_bypass = 0;
 
        if (map->cache_ops->sync) {
                ret = map->cache_ops->sync(map);
This page took 0.036165 seconds and 5 git commands to generate.