[PATCH 9/9] ASoC: rt5677: stop IRQ resume when cache sync fails

From: Pengpeng Hou

Date: Sat Sep 05 2026 - 23:48:27 EST


rt5677_resume() ignores a regcache_sync() failure after powering and
resetting the codec, then enables the IRQ and schedules a resume check.
Those operations assume that the register state has been restored.

Return the cache replay error before publishing IRQ activity. Leave the
power GPIO state unchanged on failure because deferred component resume
remains best effort and the core still marks the component resumed;
rolling power back here would create a contradictory hardware state.

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

Fixes: 0e826e867264 ("ASoC: add RT5677 CODEC driver")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <hppiscas@xxxxxxx>
---
sound/soc/codecs/rt5677.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c
index 4757017cc83d..2bcb4e5739d1 100644
--- a/sound/soc/codecs/rt5677.c
+++ b/sound/soc/codecs/rt5677.c
@@ -4956,6 +4956,7 @@ static int rt5677_suspend(struct snd_soc_component *component)
static int rt5677_resume(struct snd_soc_component *component)
{
struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
+ int ret;

if (!rt5677->dsp_vad_en) {
rt5677->pll_src = 0;
@@ -4967,7 +4968,9 @@ static int rt5677_resume(struct snd_soc_component *component)
msleep(10);

regcache_cache_only(rt5677->regmap, false);
- regcache_sync(rt5677->regmap);
+ ret = regcache_sync(rt5677->regmap);
+ if (ret)
+ return ret;
}

if (rt5677->irq) {
--
2.50.1 (Apple Git-155)