From: Mark Brown Date: Wed, 25 Jan 2012 21:05:48 +0000 (+0000) Subject: regmap: Bypass the cache when applying patches X-Git-Tag: v3.4-rc1~126^2~2^2~7 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8a892d6996b60c822f19ad1844eb15b96ce393c7;p=karo-tx-linux.git regmap: Bypass the cache when applying patches Otherwise any patch that affects a register which is writable may trash cached values. Signed-off-by: Mark Brown --- diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c index 9c6a5c13f1da..ee36bed9479c 100644 --- a/drivers/base/regmap/regcache.c +++ b/drivers/base/regmap/regcache.c @@ -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);