[PATCH v2 4/5] ASoC: rockchip: spdif: Restore regcache cache-only mode on sync failure
From: phucduc . bui
Date: Tue Jun 02 2026 - 06:37:38 EST
From: bui duc phuc <phucduc.bui@xxxxxxxxx>
If regcache_sync() fails during runtime resume, the driver disables the
clocks and returns an error. However, the regmap cache-only mode is left
disabled.
Restore cache-only mode in the error path so subsequent register accesses
continue to use the cache while the device is inactive.
Reported-by: Sashiko AI Review <sashiko-bot@xxxxxxxxxx>
Closes: https://lore.kernel.org/all/20260522103713.6C09D1F000E9@xxxxxxxxxxxxxxx/
Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
NOTE: This patch is compile-tested only. Please help test if you have
the relevant Rockchip hardware.
sound/soc/rockchip/rockchip_spdif.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/soc/rockchip/rockchip_spdif.c b/sound/soc/rockchip/rockchip_spdif.c
index 8de5b76cfe79..7f15bc7f8f35 100644
--- a/sound/soc/rockchip/rockchip_spdif.c
+++ b/sound/soc/rockchip/rockchip_spdif.c
@@ -94,6 +94,7 @@ static int rk_spdif_runtime_resume(struct device *dev)
ret = regcache_sync(spdif->regmap);
if (ret) {
+ regcache_cache_only(spdif->regmap, true);
clk_disable_unprepare(spdif->mclk);
clk_disable_unprepare(spdif->hclk);
}
--
2.43.0