ASoC: codecs: propagate component resume cache sync failures
Subsystems (4)
cover ASoC: codecs: propagate component resume cache sync failures
Commit 951af101c730 ("ASoC: report component resume callback errors") made negative component resume results visible through the existing ASoC component error helper while preserving best-effort resume.
These 14 component resume callbacks still discard the final regcache_sync() result and return success. Return that result so the common wrapper can report a failed cache replay with component context. None of these callbacks has dependent work after the sync, so the patches do not add rollback or retry semantics and do not change the successful path.
The issues were found by a tool we developed.
GPT-5 assisted with source-history review, patch construction and changelog drafting.
No dynamic reproducer was produced. The series was not built or tested on codec hardware. The 14 patches were manually reviewed, checked with checkpatch.pl and applied in order to sound/for-next at 27a50351cbc8.
The shared error-reporting contract was discussed at:
https://lore.kernel.org/r/[email protected]
Pengpeng Hou (14):
ASoC: adau17x1: return cache sync errors from resume
ASoC: ak4642: return cache sync errors from resume
ASoC: es8316: return cache sync errors from resume
ASoC: es8323: return cache sync errors from resume
ASoC: nau8540: return cache sync errors from resume
ASoC: rt1011: return cache sync errors from resume
ASoC: rt1016: return cache sync errors from resume
ASoC: rt1305: return cache sync errors from resume
ASoC: rt1308: return cache sync errors from resume
ASoC: rt1318: return cache sync errors from resume
ASoC: rt5616: return cache sync errors from resume
ASoC: rt5659: return cache sync errors from resume
ASoC: rt5660: return cache sync errors from resume
ASoC: rt5665: return cache sync errors from resume
sound/soc/codecs/adau17x1.c | 4 +--- sound/soc/codecs/ak4642.c | 3 +-- sound/soc/codecs/es8316.c | 4 +--- sound/soc/codecs/es8323.c | 4 +--- sound/soc/codecs/nau8540.c | 4 +--- sound/soc/codecs/rt1011.c | 4 +--- sound/soc/codecs/rt1016.c | 4 +--- sound/soc/codecs/rt1305.c | 4 +--- sound/soc/codecs/rt1308.c | 4 +--- sound/soc/codecs/rt1318.c | 3 +-- sound/soc/codecs/rt5616.c | 3 +-- sound/soc/codecs/rt5659.c | 4 +--- sound/soc/codecs/rt5660.c | 4 +--- sound/soc/codecs/rt5665.c | 4 +--- 14 files changed, 14 insertions(+), 39 deletions(-)
base-commit: 27a50351cbc82e9f0811df417c5e7d2a72f60ef5
Signature · 1 line
2.50.1 (Apple Git-155)
PATCH 1/14 ASoC: adau17x1: return cache sync errors from resume
adau17x1_resume() restores cached registers during component resume but discards the regcache_sync() result and returns success. A failed replay can therefore leave the hardware register state stale without reaching the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper reports a negative callback result and retains the established best-effort resume state, so this adds observability without introducing rollback or retry semantics.
The optional switch-mode callback remains ordered before the cache replay.
The issue was found by a tool we developed.
--- sound/soc/codecs/adau17x1.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/codecs/adau17x1.c +1 -3
@@ -989,9 +989,7 @@ int adau17x1_resume(struct snd_soc_component *component)if (adau->switch_mode) adau->switch_mode (component->dev); -regcache_sync (adau->regmap); - -return 0 ; +return regcache_sync (adau->regmap); }EXPORT_SYMBOL_GPL (adau17x1_resume);
Signature · 1 line
2.50.1 (Apple Git-155)
PATCH 2/14 ASoC: ak4642: return cache sync errors from resume
In reply to Pengpeng Houak4642_resume() restores cached registers during component resume but discards the regcache_sync() result and returns success. A failed replay can therefore leave the hardware register state stale without reaching the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper reports a negative callback result and retains the established best-effort resume state, so this adds observability without introducing rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
--- sound/soc/codecs/ak4642.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
sound/soc/codecs/ak4642.c +1 -2
@@ -533,8 +533,7 @@ static int ak4642_resume(struct snd_soc_component *component)struct regmap *regmap =dev_get_regmap (component->dev,NULL );regcache_cache_only (regmap, false); -regcache_sync (regmap); -return 0 ; +return regcache_sync (regmap); }static int ak4642_probe (struct snd_soc_component *component) {
Signature · 1 line
2.50.1 (Apple Git-155)
PATCH 3/14 ASoC: es8316: return cache sync errors from resume
In reply to Pengpeng Houes8316_resume() restores cached registers during component resume but discards the regcache_sync() result and returns success. A failed replay can therefore leave the hardware register state stale without reaching the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper reports a negative callback result and retains the established best-effort resume state, so this adds observability without introducing rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
--- sound/soc/codecs/es8316.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/codecs/es8316.c +1 -3
@@ -810,9 +810,7 @@ static int es8316_resume(struct snd_soc_component *component)struct es8316_priv *es8316 =snd_soc_component_get_drvdata (component);regcache_cache_only (es8316->regmap, false); -regcache_sync (es8316->regmap); - -return 0 ; +return regcache_sync (es8316->regmap); }static int es8316_suspend (struct snd_soc_component *component)
Signature · 1 line
2.50.1 (Apple Git-155)
PATCH 4/14 ASoC: es8323: return cache sync errors from resume
In reply to Pengpeng Houes8323_resume() restores cached registers during component resume but discards the regcache_sync() result and returns success. A failed replay can therefore leave the hardware register state stale without reaching the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper reports a negative callback result and retains the established best-effort resume state, so this adds observability without introducing rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
--- sound/soc/codecs/es8323.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/codecs/es8323.c +1 -3
@@ -733,9 +733,7 @@ static int es8323_resume(struct snd_soc_component *component)struct es8323_priv *es8323 =snd_soc_component_get_drvdata (component);regcache_cache_only (es8323->regmap, false); -regcache_sync (es8323->regmap); - -return 0 ; +return regcache_sync (es8323->regmap); }static const struct snd_soc_component_driver soc_component_dev_es8323 = {
Signature · 1 line
2.50.1 (Apple Git-155)
PATCH 5/14 ASoC: nau8540: return cache sync errors from resume
In reply to Pengpeng Hounau8540_resume() restores cached registers during component resume but discards the regcache_sync() result and returns success. A failed replay can therefore leave the hardware register state stale without reaching the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper reports a negative callback result and retains the established best-effort resume state, so this adds observability without introducing rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
--- sound/soc/codecs/nau8540.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/codecs/nau8540.c +1 -3
@@ -897,9 +897,7 @@ static int __maybe_unused nau8540_resume(struct snd_soc_component *component)struct nau8540 *nau8540 =snd_soc_component_get_drvdata (component);regcache_cache_only (nau8540->regmap, false); -regcache_sync (nau8540->regmap); - -return 0 ; +return regcache_sync (nau8540->regmap); }static const struct snd_soc_component_driver nau8540_component_driver = {
Signature · 1 line
2.50.1 (Apple Git-155)
PATCH 6/14 ASoC: rt1011: return cache sync errors from resume
In reply to Pengpeng Hourt1011_resume() restores cached registers during component resume but discards the regcache_sync() result and returns success. A failed replay can therefore leave the hardware register state stale without reaching the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper reports a negative callback result and retains the established best-effort resume state, so this adds observability without introducing rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
--- sound/soc/codecs/rt1011.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/codecs/rt1011.c +1 -3
@@ -2094,9 +2094,7 @@ static int rt1011_resume(struct snd_soc_component *component)struct rt1011_priv *rt1011 =snd_soc_component_get_drvdata (component);regcache_cache_only (rt1011->regmap, false); -regcache_sync (rt1011->regmap); - - return 0; + return regcache_sync(rt1011->regmap); }#else #define rt1011_suspend NULL
Signature · 1 line
2.50.1 (Apple Git-155)
PATCH 7/14 ASoC: rt1016: return cache sync errors from resume
In reply to Pengpeng Hourt1016_resume() restores cached registers during component resume but discards the regcache_sync() result and returns success. A failed replay can therefore leave the hardware register state stale without reaching the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper reports a negative callback result and retains the established best-effort resume state, so this adds observability without introducing rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
--- sound/soc/codecs/rt1016.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/codecs/rt1016.c +1 -3
@@ -570,9 +570,7 @@ static int rt1016_resume(struct snd_soc_component *component)struct rt1016_priv *rt1016 =snd_soc_component_get_drvdata (component);regcache_cache_only (rt1016->regmap, false); -regcache_sync (rt1016->regmap); - - return 0; + return regcache_sync(rt1016->regmap); }#else #define rt1016_suspend NULL
Signature · 1 line
2.50.1 (Apple Git-155)
PATCH 8/14 ASoC: rt1305: return cache sync errors from resume
In reply to Pengpeng Hourt1305_resume() restores cached registers during component resume but discards the regcache_sync() result and returns success. A failed replay can therefore leave the hardware register state stale without reaching the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper reports a negative callback result and retains the established best-effort resume state, so this adds observability without introducing rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
--- sound/soc/codecs/rt1305.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/codecs/rt1305.c +1 -3
@@ -896,9 +896,7 @@ static int rt1305_resume(struct snd_soc_component *component)struct rt1305_priv *rt1305 =snd_soc_component_get_drvdata (component);regcache_cache_only (rt1305->regmap, false); -regcache_sync (rt1305->regmap); - - return 0; + return regcache_sync(rt1305->regmap); }#else #define rt1305_suspend NULL
Signature · 1 line
2.50.1 (Apple Git-155)
PATCH 9/14 ASoC: rt1308: return cache sync errors from resume
In reply to Pengpeng Hourt1308_resume() restores cached registers during component resume but discards the regcache_sync() result and returns success. A failed replay can therefore leave the hardware register state stale without reaching the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper reports a negative callback result and retains the established best-effort resume state, so this adds observability without introducing rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
--- sound/soc/codecs/rt1308.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/codecs/rt1308.c +1 -3
@@ -715,9 +715,7 @@ static int rt1308_resume(struct snd_soc_component *component)struct rt1308_priv *rt1308 =snd_soc_component_get_drvdata (component);regcache_cache_only (rt1308->regmap, false); -regcache_sync (rt1308->regmap); - - return 0; + return regcache_sync(rt1308->regmap); }#else #define rt1308_suspend NULL
Signature · 1 line
2.50.1 (Apple Git-155)
PATCH 10/14 ASoC: rt1318: return cache sync errors from resume
In reply to Pengpeng Hourt1318_resume() restores cached registers during component resume but discards the regcache_sync() result and returns success. A failed replay can therefore leave the hardware register state stale without reaching the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper reports a negative callback result and retains the established best-effort resume state, so this adds observability without introducing rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
--- sound/soc/codecs/rt1318.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
sound/soc/codecs/rt1318.c +1 -2
@@ -1075,8 +1075,7 @@ static int rt1318_resume(struct snd_soc_component *component)struct rt1318_priv *rt1318 =snd_soc_component_get_drvdata (component);regcache_cache_only (rt1318->regmap, false); -regcache_sync (rt1318->regmap); - return 0; + return regcache_sync(rt1318->regmap); }#else #define rt1318_suspend NULL
Signature · 1 line
2.50.1 (Apple Git-155)
PATCH 11/14 ASoC: rt5616: return cache sync errors from resume
In reply to Pengpeng Hourt5616_resume() restores cached registers during component resume but discards the regcache_sync() result and returns success. A failed replay can therefore leave the hardware register state stale without reaching the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper reports a negative callback result and retains the established best-effort resume state, so this adds observability without introducing rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
--- sound/soc/codecs/rt5616.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
sound/soc/codecs/rt5616.c +1 -2
@@ -1248,8 +1248,7 @@ static int rt5616_resume(struct snd_soc_component *component)struct rt5616_priv *rt5616 =snd_soc_component_get_drvdata (component);regcache_cache_only (rt5616->regmap, false); -regcache_sync (rt5616->regmap); - return 0; + return regcache_sync(rt5616->regmap); }#else #define rt5616_suspend NULL
Signature · 1 line
2.50.1 (Apple Git-155)
PATCH 12/14 ASoC: rt5659: return cache sync errors from resume
In reply to Pengpeng Hourt5659_resume() restores cached registers during component resume but discards the regcache_sync() result and returns success. A failed replay can therefore leave the hardware register state stale without reaching the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper reports a negative callback result and retains the established best-effort resume state, so this adds observability without introducing rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
--- sound/soc/codecs/rt5659.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/codecs/rt5659.c +1 -3
@@ -3703,9 +3703,7 @@ static int rt5659_resume(struct snd_soc_component *component)struct rt5659_priv *rt5659 =snd_soc_component_get_drvdata (component);regcache_cache_only (rt5659->regmap, false); -regcache_sync (rt5659->regmap); - - return 0; + return regcache_sync(rt5659->regmap); }#else #define rt5659_suspend NULL
Signature · 1 line
2.50.1 (Apple Git-155)
PATCH 13/14 ASoC: rt5660: return cache sync errors from resume
In reply to Pengpeng Hourt5660_resume() restores cached registers during component resume but discards the regcache_sync() result and returns success. A failed replay can therefore leave the hardware register state stale without reaching the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper reports a negative callback result and retains the established best-effort resume state, so this adds observability without introducing rollback or retry semantics.
The power-off resume delay remains ordered before the cache replay.
The issue was found by a tool we developed.
--- sound/soc/codecs/rt5660.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/codecs/rt5660.c +1 -3
@@ -1148,9 +1148,7 @@ static int rt5660_resume(struct snd_soc_component *component)msleep (350 );regcache_cache_only (rt5660->regmap, false); -regcache_sync (rt5660->regmap); - - return 0; + return regcache_sync(rt5660->regmap); }#else #define rt5660_suspend NULL
Signature · 1 line
2.50.1 (Apple Git-155)
PATCH 14/14 ASoC: rt5665: return cache sync errors from resume
In reply to Pengpeng Hourt5665_resume() restores cached registers during component resume but discards the regcache_sync() result and returns success. A failed replay can therefore leave the hardware register state stale without reaching the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper reports a negative callback result and retains the established best-effort resume state, so this adds observability without introducing rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
--- sound/soc/codecs/rt5665.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/codecs/rt5665.c +1 -3
@@ -4388,9 +4388,7 @@ static int rt5665_resume(struct snd_soc_component *component)struct rt5665_priv *rt5665 =snd_soc_component_get_drvdata (component);regcache_cache_only (rt5665->regmap, false); -regcache_sync (rt5665->regmap); - - return 0; + return regcache_sync(rt5665->regmap); }#else #define rt5665_suspend NULL
Signature · 1 line
2.50.1 (Apple Git-155)
Mark Brown
maintainerQuoted 6 lines · Pengpeng Hou
ASoC: codecs: propagate component resume cache sync failures
Commit
951af101c730("ASoC: report component resume callback errors") made negative component resume results visible through the existing ASoC component error helper while preserving best-effort resume.
Quoted 7 lines
These 14 component resume callbacks still discard the final
regcache_sync()result and return success. Return that result so the common wrapper can report a failed cache replay with component context. None of these callbacks has dependent work after the sync, so the patches do not add rollback or retry semantics and do not change the successful path.[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.4
Thanks!
[01/14] ASoC: adau17x1: return cache sync errors from resume
https://git.kernel.org/broonie/sound/c/8ca84987c11d [02/14] ASoC: ak4642: return cache sync errors from resume https://git.kernel.org/broonie/sound/c/7142c34ed92f [03/14] ASoC: es8316: return cache sync errors from resume https://git.kernel.org/broonie/sound/c/243d0c47e57a [04/14] ASoC: es8323: return cache sync errors from resume https://git.kernel.org/broonie/sound/c/b7c3f95915a9 [05/14] ASoC: nau8540: return cache sync errors from resume https://git.kernel.org/broonie/sound/c/0bf2b3411537 [06/14] ASoC: rt1011: return cache sync errors from resume https://git.kernel.org/broonie/sound/c/432734a00bfa [07/14] ASoC: rt1016: return cache sync errors from resume https://git.kernel.org/broonie/sound/c/98ace05793c7 [08/14] ASoC: rt1305: return cache sync errors from resume https://git.kernel.org/broonie/sound/c/30858325aa90 [09/14] ASoC: rt1308: return cache sync errors from resume https://git.kernel.org/broonie/sound/c/3db3289178b9 [10/14] ASoC: rt1318: return cache sync errors from resume https://git.kernel.org/broonie/sound/c/a5735b341c6e [11/14] ASoC: rt5616: return cache sync errors from resume https://git.kernel.org/broonie/sound/c/8fc9d353d537 [12/14] ASoC: rt5659: return cache sync errors from resume https://git.kernel.org/broonie/sound/c/3a9b5bce85a1 [13/14] ASoC: rt5660: return cache sync errors from resume https://git.kernel.org/broonie/sound/c/70fe8997b030 [14/14] ASoC: rt5665: return cache sync errors from resume https://git.kernel.org/broonie/sound/c/9f2933d9a437
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