[RFC PATCH v2] ASoC: report component resume callback errors
From: Pengpeng Hou
Date: Tue Aug 25 2026 - 04:55:15 EST
snd_soc_component_driver::resume() returns an int, but
snd_soc_component_resume() discards it. In the deferred resume path,
snd_soc_resume() has already returned success to the PM core, so an error
cannot be propagated back to that caller.
Pass the callback result through the existing ASoC component error helper.
This reports negative results with component context while preserving the
established best-effort behavior: the component is still marked resumed
and the worker continues DAPM resume, digital unmute and card power
publication.
There are existing callbacks, including tas2562_resume() and
atmel_classd_component_resume(), which directly return regcache_sync()
errors. Those errors currently disappear at the component wrapper.
This only makes errors already returned by component callbacks observable.
It does not expose operations that individual callbacks ignore, and it
does not add rollback or retry semantics. Callbacks which already report
an error may retain their driver-specific message in addition to the
common ASoC component context, as with other ASoC component wrappers.
This is an RFC to confirm that reporting and continuing is the intended
contract for deferred component resume failures.
Signed-off-by: Pengpeng Hou <pengpeng@xxxxxxxxxxx>
---
Changes since the RFC:
- provide a concrete core patch instead of only asking a policy question
- select centralized reporting while retaining asynchronous best-effort
resume and all existing state transitions
- use the existing ASoC component error helper
- keep driver-local restore transactions out of scope; the 33 sites listed
previously remain an audit population, not 33 claimed fixes
Previous RFC:
https://lore.kernel.org/all/20260721055807.85110-1-pengpeng@xxxxxxxxxxx/
sound/soc/soc-component.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c
index dc7d203cb76af..463ea227cac81 100644
--- a/sound/soc/soc-component.c
+++ b/sound/soc/soc-component.c
@@ -315,8 +315,12 @@ void snd_soc_component_suspend(struct snd_soc_component *component)
void snd_soc_component_resume(struct snd_soc_component *component)
{
- if (component->driver->resume)
- component->driver->resume(component);
+ int ret;
+
+ if (component->driver->resume) {
+ ret = component->driver->resume(component);
+ soc_component_ret(component, ret);
+ }
component->suspended = 0;
}
base-commit: 2be02a7c996aa733bb36e29e07715621b0de9736
--
2.50.1 (Apple Git-155)