mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: fsl: imx-rpmsg: use snd_soc_find_dai_with_mutex() in probe
@ 2026-02-05  5:24 Ziyi Guo
  2026-02-05 15:17 ` Frank Li
  2026-02-05 22:40 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Ziyi Guo @ 2026-02-05  5:24 UTC (permalink / raw)
  To: Shengjiu Wang, Xiubo Li
  Cc: Fabio Estevam, Nicolin Chen, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Shawn Guo, Sascha Hauer, kernel,
	linux-sound, imx, linux-arm-kernel, linux-kernel, Ziyi Guo

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>
---
 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 53f04d1f3280..76a8e68c1b62 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.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-02-05 22:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-05  5:24 [PATCH] ASoC: fsl: imx-rpmsg: use snd_soc_find_dai_with_mutex() in probe Ziyi Guo
2026-02-05 15:17 ` Frank Li
2026-02-05 22:40 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®