From 39dadd459c88d1eb5dc7ccbfc605cf078c162b96 Mon Sep 17 00:00:00 2001 From: Pengpeng Hou Date: Sat, 4 Jul 2026 12:04:18 +0800 Subject: [PATCH] ASoC: codecs: rt1320-sdw: Propagate regcache_sync() errors rt1320_dev_resume() clears cache-only mode for both regmaps and replays cached register state into the device. Both regcache_sync() calls currently ignore their return values, so resume can report success even if either replay failed. Check both sync operations and return the first error. On failure, restore both regmaps to cache-only mode and mark both caches dirty, so a later successful resume attempt starts from a coherent suspended cache state instead of a partially live pair of regmaps. Signed-off-by: Pengpeng Hou Link: https://patch.msgid.link/20260704040418.28181-1-pengpeng@iscas.ac.cn Signed-off-by: Mark Brown --- sound/soc/codecs/rt1320-sdw.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/rt1320-sdw.c b/sound/soc/codecs/rt1320-sdw.c index 18d7ebff505f..a30fb575918d 100644 --- a/sound/soc/codecs/rt1320-sdw.c +++ b/sound/soc/codecs/rt1320-sdw.c @@ -3626,10 +3626,23 @@ static int rt1320_dev_resume(struct device *dev) return ret; regcache_cache_only(rt1320->regmap, false); - regcache_sync(rt1320->regmap); + ret = regcache_sync(rt1320->regmap); + if (ret) + goto err_sync; + regcache_cache_only(rt1320->mbq_regmap, false); - regcache_sync(rt1320->mbq_regmap); + ret = regcache_sync(rt1320->mbq_regmap); + if (ret) + goto err_sync; + return 0; + +err_sync: + regcache_cache_only(rt1320->regmap, true); + regcache_cache_only(rt1320->mbq_regmap, true); + regcache_mark_dirty(rt1320->regmap); + regcache_mark_dirty(rt1320->mbq_regmap); + return ret; } static const struct dev_pm_ops rt1320_pm = {