From: Pengpeng Hou <hppiscas@163.com>
To: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>
Cc: Pengpeng Hou <hppiscas@163.com>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>, Seven Lee <wtli@nuvoton.com>,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/9] ASoC: nau8821: stop resume when cache sync fails
Date: Sun, 6 Sep 2026 11:43:13 +0800 [thread overview]
Message-ID: <20260906034321.86080-2-hppiscas@163.com> (raw)
nau8821_resume() restores cached registers during component resume but
ignores a regcache_sync() failure and continues with 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: aab1ad11d69f ("ASoC: nau8821: new driver")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
---
sound/soc/codecs/nau8821.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/nau8821.c b/sound/soc/codecs/nau8821.c
index c45c5b864ea4..c79be1c07f66 100644
--- a/sound/soc/codecs/nau8821.c
+++ b/sound/soc/codecs/nau8821.c
@@ -1628,9 +1628,13 @@ static int __maybe_unused nau8821_suspend(struct snd_soc_component *component)
static int __maybe_unused nau8821_resume(struct snd_soc_component *component)
{
struct nau8821 *nau8821 = snd_soc_component_get_drvdata(component);
+ int ret;
regcache_cache_only(nau8821->regmap, false);
- regcache_sync(nau8821->regmap);
+ ret = regcache_sync(nau8821->regmap);
+ if (ret)
+ return ret;
+
if (nau8821->irq)
enable_irq(nau8821->irq);
--
2.50.1 (Apple Git-155)
next reply other threads:[~2026-09-06 3:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-06 3:43 Pengpeng Hou [this message]
2026-09-07 11:47 ` [PATCH 1/9] ASoC: nau8821: stop resume when cache sync fails Mark Brown
2026-09-08 11:45 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260906034321.86080-2-hppiscas@163.com \
--to=hppiscas@163.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
--cc=wtli@nuvoton.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox