mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2/9] ASoC: nau8824: stop resume when cache sync fails
@ 2026-09-06  3:43 Pengpeng Hou
  0 siblings, 0 replies; only message 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, John Hsu,
	linux-sound, linux-kernel

nau8824_resume() restores cached registers during component resume but
ignores a regcache_sync() failure and continues with jack-detection
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: dfeabded0496 ("ASoC: nau8824: new driver")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
---
 sound/soc/codecs/nau8824.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/nau8824.c b/sound/soc/codecs/nau8824.c
index 426a488ff2a3..42d6ddd66e2b 100644
--- a/sound/soc/codecs/nau8824.c
+++ b/sound/soc/codecs/nau8824.c
@@ -1546,7 +1546,10 @@ static int __maybe_unused nau8824_resume(struct snd_soc_component *component)
 	int ret;
 
 	regcache_cache_only(nau8824->regmap, false);
-	regcache_sync(nau8824->regmap);
+	ret = regcache_sync(nau8824->regmap);
+	if (ret)
+		return ret;
+
 	if (nau8824->irq) {
 		/* Hold semaphore to postpone playback happening
 		 * until jack detection done.
-- 
2.50.1 (Apple Git-155)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-06  3:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-06  3:43 [PATCH 2/9] ASoC: nau8824: stop resume when cache sync fails Pengpeng Hou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®