regcache: Mark cache dirty if selector register rewrite fails

After a successful cache synchronization, regcache_sync() clears
cache_dirty. If rewriting a selector register later fails, the cache
and hardware become inconsistent while the cache still appears clean.

Update cache_dirty to reflect the cache and hardware state when
selector register rewriting fails.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260713050312.38729-3-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
bui duc phuc 2026-07-13 12:03:12 +07:00 committed by Mark Brown
parent 85da24aac1
commit a7d168db6b
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -465,6 +465,7 @@ int regcache_sync(struct regmap *map)
selector_ret = _regmap_write(map, this->selector_reg, i);
if (selector_ret != 0) {
map->cache_dirty = true;
dev_err(map->dev, "Failed to write %x = %x: %d\n",
this->selector_reg, i, selector_ret);
break;