Skip to contentSkip to conversation

ASoC: nau8825: stop resume when cache sync fails

PATCH In review Pengpeng Hou 1 participant 1 message Sep 6

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/9 ASoC: nau8825: stop resume when cache sync fails

nau8825_resume() restores cached registers during component resume but ignores a regcache_sync() failure and continues with crosstalk semaphore handling and IRQ enablement. Those operations assume that the codec register state has already been restored.

Stop the local resume sequence when cache replay fails and return the error to the ASoC component wrapper. The wrapper reports the failure while retaining best-effort card resume, so no rollback or retry semantics are introduced.

The issue was found by our static-analysis tool and manually reviewed.

Fixes 4454a8378be5 ("ASoC: nau8825: add pm function")
Assisted-by gpt 5
---
 sound/soc/codecs/nau8825.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
sound/soc/codecs/nau8825.c +4 -1
index ae83b778bf93..c770a345f3cf 100644
@@ -2690,7 +2690,10 @@ static int __maybe_unused nau8825_resume(struct snd_soc_component *component)
 	int ret;
 
 	regcache_cache_only(nau8825->regmap, false);
-	regcache_sync(nau8825->regmap);
+	ret = regcache_sync(nau8825->regmap);
+	if (ret)
+		return ret;
+
 	nau8825->xtalk_protect = true;
 	ret = nau8825_sema_acquire(nau8825, 0);
 	if (ret)
Signature · 1 line
2.50.1 (Apple Git-155)