* [PATCH 1/9] ASoC: nau8821: stop resume when cache sync fails
@ 2026-09-06 3:43 Pengpeng Hou
2026-09-07 11:47 ` Mark Brown
2026-09-08 11:45 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Pengpeng Hou @ 2026-09-06 3:43 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown
Cc: Pengpeng Hou, Jaroslav Kysela, Takashi Iwai, Seven Lee,
linux-sound, linux-kernel
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)
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH 1/9] ASoC: nau8821: stop resume when cache sync fails
2026-09-06 3:43 [PATCH 1/9] ASoC: nau8821: stop resume when cache sync fails Pengpeng Hou
@ 2026-09-07 11:47 ` Mark Brown
2026-09-08 11:45 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-09-07 11:47 UTC (permalink / raw)
To: Pengpeng Hou
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Seven Lee,
linux-sound, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 676 bytes --]
On Sun, Sep 06, 2026 at 11:43:13AM +0800, Pengpeng Hou wrote:
> 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.
Something seems up with your mail, neither this nor the other series you
posted at roughly the same time "ASoC: report additional component
restore failures" ended up threaded together.
You might want to look at b4 to send the patches, especially it's web
submission endpoint which avoids having to configure mail:
https://b4.docs.kernel.org/en/latest/contributor/overview.html
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/9] ASoC: nau8821: stop resume when cache sync fails
2026-09-06 3:43 [PATCH 1/9] ASoC: nau8821: stop resume when cache sync fails Pengpeng Hou
2026-09-07 11:47 ` Mark Brown
@ 2026-09-08 11:45 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-09-08 11:45 UTC (permalink / raw)
To: Pengpeng Hou
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Seven Lee,
linux-sound, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 536 bytes --]
On Sun, Sep 06, 2026 at 11:43:13AM +0800, Pengpeng Hou wrote:
> 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.
> regcache_cache_only(nau8821->regmap, false);
> - regcache_sync(nau8821->regmap);
> + ret = regcache_sync(nau8821->regmap);
> + if (ret)
> + return ret;
This leaves the cache in write through mode which is probably going to
be a bad time.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-08 11:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-06 3:43 [PATCH 1/9] ASoC: nau8821: stop resume when cache sync fails Pengpeng Hou
2026-09-07 11:47 ` Mark Brown
2026-09-08 11:45 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox