* [PATCH 1/4] ASoC: es8326: report resume restore errors
@ 2026-09-06 3:42 Pengpeng Hou
2026-09-07 22:49 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Pengpeng Hou @ 2026-09-06 3:42 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown
Cc: Pengpeng Hou, Jaroslav Kysela, Takashi Iwai, David Yang, Zhu Ning,
linux-sound, linux-kernel
es8326_resume() ignores the status-register read, the direct clock-state
write and the register-cache replay. A read failure can also leave reg
uninitialized before it selects the reset path, and a cache failure is
followed by jack IRQ processing.
Return these errors before later resume work. The ASoC component wrapper
reports the callback failure while retaining its best-effort resume
contract.
The issue was found by our static-analysis tool and manually reviewed.
Fixes: 5c439937775d ("ASoC: codecs: add support for ES8326")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
---
sound/soc/codecs/es8326.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/es8326.c b/sound/soc/codecs/es8326.c
index c5460589a88b..ab0280b06e5c 100644
--- a/sound/soc/codecs/es8326.c
+++ b/sound/soc/codecs/es8326.c
@@ -1118,18 +1118,28 @@ static int es8326_resume(struct snd_soc_component *component)
{
struct es8326_priv *es8326 = snd_soc_component_get_drvdata(component);
unsigned int reg;
+ int ret;
regcache_cache_only(es8326->regmap, false);
regcache_cache_bypass(es8326->regmap, true);
- regmap_read(es8326->regmap, ES8326_CLK_RESAMPLE, ®);
+ ret = regmap_read(es8326->regmap, ES8326_CLK_RESAMPLE, ®);
regcache_cache_bypass(es8326->regmap, false);
+ if (ret)
+ return ret;
+
/* reset internal clock state */
- if (reg == 0x05)
- regmap_write(es8326->regmap, ES8326_CLK_CTL, ES8326_CLK_ON);
- else
+ if (reg == 0x05) {
+ ret = regmap_write(es8326->regmap, ES8326_CLK_CTL,
+ ES8326_CLK_ON);
+ if (ret)
+ return ret;
+ } else {
es8326_init(component);
+ }
- regcache_sync(es8326->regmap);
+ ret = regcache_sync(es8326->regmap);
+ if (ret)
+ return ret;
es8326_irq(es8326->irq, es8326);
return 0;
--
2.50.1 (Apple Git-155)
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH 1/4] ASoC: es8326: report resume restore errors
2026-09-06 3:42 [PATCH 1/4] ASoC: es8326: report resume restore errors Pengpeng Hou
@ 2026-09-07 22:49 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2026-09-07 22:49 UTC (permalink / raw)
To: Liam Girdwood, Pengpeng Hou
Cc: Jaroslav Kysela, Takashi Iwai, David Yang, Zhu Ning, linux-sound,
linux-kernel
On Sun, 06 Sep 2026 11:42:14 +0800, Pengpeng Hou wrote:
> ASoC: es8326: report resume restore errors
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.4
Thanks!
[1/4] ASoC: es8326: report resume restore errors
https://git.kernel.org/broonie/sound/c/349e94679968
[2/4] ASoC: es8375: report resume restore errors
https://git.kernel.org/broonie/sound/c/8f43acfd3add
[3/4] ASoC: es8389: report resume restore errors
https://git.kernel.org/broonie/sound/c/8f7d23eb8ffb
[4/4] ASoC: fs210x: report register restore errors
https://git.kernel.org/broonie/sound/c/aa7d985d8552
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-08 15:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-06 3:42 [PATCH 1/4] ASoC: es8326: report resume restore errors Pengpeng Hou
2026-09-07 22:49 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).