linux/sound/soc/generic
Cássio Gabriel aa173b70d3
ASoC: generic: keep fallback dai_name stable across rebind
simple_parse_dai() and graph_util_parse_dai() first try to identify a
DAI via dai_args. When that works the card can rebind without relying on
dlc->dai_name.

The fallback path still calls snd_soc_get_dlc(), which returns a
borrowed dai_name pointer. If the CPU or codec component is unbound
while the sound card stays registered, the generic card keeps that
pointer and the next rebind may compare stale memory while matching the
DAI.

Stage the fallback result in a temporary dai_link_component and move
only a card-owned copy of dai_name into the live link component. Use
devm_kstrdup_const() so static names are reused and dynamic ones remain
valid for the lifetime of the card device.

Suggested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
Link: https://patch.msgid.link/20260327-asoc-generic-fallback-dai-name-rebind-v3-1-c206e44f40c8@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-30 20:06:54 +01:00
..
audio-graph-card.c ASoC: soc-component: remove pcm_construct()/pcm_destruct() 2026-03-16 13:38:08 +00:00
audio-graph-card2-custom-sample.c ASoC: Switch back to struct platform_driver::remove() 2024-09-09 18:26:49 +01:00
audio-graph-card2-custom-sample1.dtsi ASoC: audio-graph-card2-custom-sample1.dtsi: Separate Sample DT 2025-03-03 12:59:52 +00:00
audio-graph-card2-custom-sample2.dtsi ASoC: audio-graph-card2-custom-sample2.dtsi: Separate Sample DT 2025-03-03 12:59:53 +00:00
audio-graph-card2.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Kconfig ASoC: generic: Standardize ASoC menu 2025-06-24 01:01:36 +01:00
Makefile ASoC: generic: Use *-y instead of *-objs in Makefile 2024-05-08 11:39:19 +09:00
simple-card-utils.c ASoC: generic: keep fallback dai_name stable across rebind 2026-03-30 20:06:54 +01:00
simple-card.c ASoC: generic: keep fallback dai_name stable across rebind 2026-03-30 20:06:54 +01:00
test-component.c ASoC: generic: name back to pcm_new()/pcm_free() 2026-03-16 13:37:51 +00:00