* [PATCH AUTOSEL 6.19-6.12] ASoC: fsl: imx-rpmsg: use snd_soc_find_dai_with_mutex() in probe
[not found] <20260214010245.3671907-1-sashal@kernel.org>
@ 2026-02-14 0:58 ` Sasha Levin
0 siblings, 0 replies; only message in thread
From: Sasha Levin @ 2026-02-14 0:58 UTC (permalink / raw)
To: patches, stable
Cc: Ziyi Guo, Frank Li, Mark Brown, Sasha Levin, shengjiu.wang,
Xiubo.Lee, linux-sound, linuxppc-dev, imx, linux-arm-kernel
From: Ziyi Guo <n7l8m4@u.northwestern.edu>
[ Upstream commit 84faa91585fa22a161763f2fe8f84a602a196c87 ]
imx_rpmsg_probe() calls snd_soc_find_dai() without holding client_mutex.
However, snd_soc_find_dai() has lockdep_assert_held(&client_mutex)
indicating callers must hold this lock, as the function iterates over the
global component list.
All other callers of snd_soc_find_dai() either hold client_mutex via the
snd_soc_bind_card() path or use the snd_soc_find_dai_with_mutex() wrapper.
Use snd_soc_find_dai_with_mutex() instead to fix the missing lock
protection.
Signed-off-by: Ziyi Guo <n7l8m4@u.northwestern.edu>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260205052429.4046903-1-n7l8m4@u.northwestern.edu
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
The wrapper was added in 2020, so it exists in all currently maintained
stable trees (5.10+, 5.15+, 6.1+, 6.6+, 6.12+). This confirms the fix
will apply cleanly to all relevant stable branches.
### User Impact
- Without this fix, users with i.MX RPMSG sound cards will hit **lockdep
warnings** during probe when `CONFIG_PROVE_LOCKING` is enabled
- More seriously, without the lock, there is a real (though perhaps
rare) **race condition** where concurrent component
registration/deregistration during probe could corrupt the component
list, leading to crashes or undefined behavior
- The i.MX RPMSG audio is used on NXP i.MX SoC platforms, which are
widely deployed in embedded systems
### Stability Indicators
- **Reviewed-by: Frank Li** (NXP maintainer) - indicates domain
expertise review
- **Applied by Mark Brown** (ASoC subsystem maintainer) - indicates
acceptance by the subsystem maintainer
- Single-line change with zero risk of regression
### Summary
This is a textbook stable backport candidate:
1. **Fixes a real bug**: Missing lock protection for a global list
traversal (race condition + lockdep warning)
2. **Obviously correct**: Uses the existing mutex wrapper that all other
callers use
3. **Small and surgical**: Single line change
4. **No new features**: Just corrects locking
5. **Low risk**: The wrapper function has existed since 2020 and is
well-tested
6. **No dependencies**: Self-contained fix
**YES**
sound/soc/fsl/imx-rpmsg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/fsl/imx-rpmsg.c b/sound/soc/fsl/imx-rpmsg.c
index 53f04d1f32806..76a8e68c1b620 100644
--- a/sound/soc/fsl/imx-rpmsg.c
+++ b/sound/soc/fsl/imx-rpmsg.c
@@ -145,7 +145,7 @@ static int imx_rpmsg_probe(struct platform_device *pdev)
data->dai.ignore_pmdown_time = 1;
data->dai.cpus->dai_name = pdev->dev.platform_data;
- cpu_dai = snd_soc_find_dai(data->dai.cpus);
+ cpu_dai = snd_soc_find_dai_with_mutex(data->dai.cpus);
if (!cpu_dai) {
ret = -EPROBE_DEFER;
goto fail;
--
2.51.0
^ permalink raw reply related [flat|nested] only message in thread