[RFC PATCH v2] ASoC: report component resume callback errors

Pengpeng Hou <[email protected]>
Newsgroups gmane.linux.sound,gmane.linux.kernel
Message-ID <[email protected]>
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 <[email protected]>
---
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/[email protected]/

 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)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.