[PATCH 4/9] ASoC: rt5663: stop resume when cache sync fails
From: Pengpeng Hou
Date: Sat Sep 05 2026 - 23:48:09 EST
rt5663_resume() restores cached registers during component resume but
ignores a regcache_sync() failure and continues with jack IRQ processing
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: df7c52168ee1 ("ASoC: add rt5663 codec driver")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <hppiscas@xxxxxxx>
---
sound/soc/codecs/rt5663.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/rt5663.c b/sound/soc/codecs/rt5663.c
index 262d3bba1f3d..b3d16c6d2a00 100644
--- a/sound/soc/codecs/rt5663.c
+++ b/sound/soc/codecs/rt5663.c
@@ -3202,9 +3202,12 @@ static int rt5663_suspend(struct snd_soc_component *component)
static int rt5663_resume(struct snd_soc_component *component)
{
struct rt5663_priv *rt5663 = snd_soc_component_get_drvdata(component);
+ int ret;
regcache_cache_only(rt5663->regmap, false);
- regcache_sync(rt5663->regmap);
+ ret = regcache_sync(rt5663->regmap);
+ if (ret)
+ return ret;
rt5663_irq(0, rt5663);
--
2.50.1 (Apple Git-155)