* [PATCH 0/2] ASoC: fix the x1e80100 card after an ADSP restart
@ 2026-11-06 5:43 Tyler Baker
2026-11-06 5:43 ` [PATCH 1/2] ASoC: soc-core: copy the DAI link names into the card Tyler Baker
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Tyler Baker @ 2026-11-06 5:43 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood
Cc: Srinivas Kandagatla, Kuninori Morimoto, Martin Povišer,
Krzysztof Kozlowski, Jaroslav Kysela, Takashi Iwai, linux-sound,
linux-arm-msm, linux-kernel
On Qualcomm boards an ADSP restart unbinds and rebinds the LPASS pin
controller, the SoundWire controllers and the codecs, and the card binds
again once they are back. On the Hamoa IoT EVK two things break on that
path: the DAI link names point at the SoundWire controllers' freed
strings, and the headset jack is never recreated.
The speakers also need Abel's reset-gpio parent fix [1] and the
gpiolib-shared follow-up [2].
Tested on the Hamoa IoT EVK on next-20261103: ADSP crash idle and
during playback, the card comes back with its controls, the headset
jack and working playback.
[1] https://lore.kernel.org/r/20261026-b4-reset-gpio-parent-to-gpio-controller-v1-1-11549e6ea930@oss.qualcomm.com
[2] https://lore.kernel.org/r/20261106052851.2741296-1-tyler.baker@oss.qualcomm.com
Tyler Baker (2):
ASoC: soc-core: copy the DAI link names into the card
ASoC: qcom: x1e80100: recreate the headset jack on card rebind
sound/soc/qcom/x1e80100.c | 18 ++++++++++++++++++
sound/soc/soc-core.c | 16 ++++++++++++++++
2 files changed, 34 insertions(+)
--
2.47.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] ASoC: soc-core: copy the DAI link names into the card
2026-11-06 5:43 [PATCH 0/2] ASoC: fix the x1e80100 card after an ADSP restart Tyler Baker
@ 2026-11-06 5:43 ` Tyler Baker
2026-11-06 5:52 ` sashiko-bot
2026-11-06 5:43 ` [PATCH 2/2] ASoC: qcom: x1e80100: recreate the headset jack on card rebind Tyler Baker
2026-11-09 12:33 ` [PATCH 0/2] ASoC: fix the x1e80100 card after an ADSP restart Mark Brown
2 siblings, 1 reply; 6+ messages in thread
From: Tyler Baker @ 2026-11-06 5:43 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood
Cc: Srinivas Kandagatla, Kuninori Morimoto, Martin Povišer,
Krzysztof Kozlowski, Jaroslav Kysela, Takashi Iwai, linux-sound,
linux-arm-msm, linux-kernel
snd_soc_of_get_dai_link_codecs() and snd_soc_of_get_dai_link_cpus()
keep a DAI name owned by the component, which is freed when the
component unbinds, so the card cannot bind again afterwards.
Copy the name onto the card device, as simple-card and audio-graph-card
do since commit aa173b70d372 ("ASoC: generic: keep fallback dai_name
stable across rebind").
Fixes: e894efef9ac7 ("ASoC: core: add support to card rebind")
Fixes: 900dedd7e47c ("ASoC: Introduce snd_soc_of_get_dai_link_cpus")
Signed-off-by: Tyler Baker <tyler.baker@oss.qualcomm.com>
---
sound/soc/soc-core.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index f33bece378b61..0e62965e35aaa 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3253,6 +3253,18 @@ void snd_soc_of_put_dai_link_codecs(struct snd_soc_dai_link *dai_link)
}
EXPORT_SYMBOL_GPL(snd_soc_of_put_dai_link_codecs);
+/* dai_name belongs to the component, which can unbind before the card. */
+static int snd_soc_of_dup_dai_name(struct device *dev,
+ struct snd_soc_dai_link_component *dlc)
+{
+ if (!dlc->dai_name)
+ return 0;
+
+ dlc->dai_name = devm_kstrdup_const(dev, dlc->dai_name, GFP_KERNEL);
+
+ return dlc->dai_name ? 0 : -ENOMEM;
+}
+
/*
* snd_soc_of_get_dai_link_codecs - Parse a list of CODECs in the devicetree
* @dev: Card device
@@ -3282,6 +3294,8 @@ int snd_soc_of_get_dai_link_codecs(struct device *dev,
/* Parse the list */
for_each_link_codecs(dai_link, index, component) {
ret = snd_soc_of_get_dlc(of_node, NULL, component, index);
+ if (!ret)
+ ret = snd_soc_of_dup_dai_name(dev, component);
if (ret)
goto err;
}
@@ -3337,6 +3351,8 @@ int snd_soc_of_get_dai_link_cpus(struct device *dev,
/* Parse the list */
for_each_link_cpus(dai_link, index, component) {
ret = snd_soc_of_get_dlc(of_node, NULL, component, index);
+ if (!ret)
+ ret = snd_soc_of_dup_dai_name(dev, component);
if (ret)
goto err;
}
--
2.47.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] ASoC: qcom: x1e80100: recreate the headset jack on card rebind
2026-11-06 5:43 [PATCH 0/2] ASoC: fix the x1e80100 card after an ADSP restart Tyler Baker
2026-11-06 5:43 ` [PATCH 1/2] ASoC: soc-core: copy the DAI link names into the card Tyler Baker
@ 2026-11-06 5:43 ` Tyler Baker
2026-11-06 6:01 ` sashiko-bot
2026-11-09 12:33 ` [PATCH 0/2] ASoC: fix the x1e80100 card after an ADSP restart Mark Brown
2 siblings, 1 reply; 6+ messages in thread
From: Tyler Baker @ 2026-11-06 5:43 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood
Cc: Srinivas Kandagatla, Kuninori Morimoto, Martin Povišer,
Krzysztof Kozlowski, Jaroslav Kysela, Takashi Iwai, linux-sound,
linux-arm-msm, linux-kernel
The headset jack is only created while jack_setup is false and nothing
clears it, so after a card rebind it is not created again and the
codecs keep a pointer to the freed jack.
Clear it on link exit, as sc8280xp does.
Fixes: 6b9dc2da6657 ("ASoC: qcom: Add x1e80100 sound machine driver")
Signed-off-by: Tyler Baker <tyler.baker@oss.qualcomm.com>
---
sound/soc/qcom/x1e80100.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/sound/soc/qcom/x1e80100.c b/sound/soc/qcom/x1e80100.c
index c81df41ace883..213d7f45198cb 100644
--- a/sound/soc/qcom/x1e80100.c
+++ b/sound/soc/qcom/x1e80100.c
@@ -68,6 +68,23 @@ static int x1e80100_snd_init(struct snd_soc_pcm_runtime *rtd)
return qcom_snd_wcd_jack_setup(rtd, &data->jack, &data->jack_setup);
}
+static void x1e80100_snd_exit(struct snd_soc_pcm_runtime *rtd)
+{
+ struct x1e80100_snd_data *data = snd_soc_card_get_drvdata(rtd->card);
+ struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
+
+ switch (cpu_dai->id) {
+ case DISPLAY_PORT_RX_0:
+ case DISPLAY_PORT_RX_1 ... DISPLAY_PORT_RX_7:
+ return;
+ default:
+ break;
+ }
+
+ qcom_snd_headset_jack_cleanup(rtd);
+ data->jack_setup = false;
+}
+
static int x1e80100_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params)
{
@@ -172,6 +189,7 @@ static void x1e80100_add_be_ops(struct snd_soc_card *card)
for_each_card_prelinks(card, i, link) {
if (link->no_pcm == 1) {
link->init = x1e80100_snd_init;
+ link->exit = x1e80100_snd_exit;
link->be_hw_params_fixup = x1e80100_be_hw_params_fixup;
link->ops = &x1e80100_be_ops;
}
--
2.47.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] ASoC: soc-core: copy the DAI link names into the card
2026-11-06 5:43 ` [PATCH 1/2] ASoC: soc-core: copy the DAI link names into the card Tyler Baker
@ 2026-11-06 5:52 ` sashiko-bot
0 siblings, 0 replies; 6+ messages in thread
From: sashiko-bot @ 2026-11-06 5:52 UTC (permalink / raw)
To: Tyler Baker; +Cc: linux-sound
Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [Medium] ASoC: soc-core: memory leak in snd_soc_of_get_dlc() [1]
--
commit fe7efa2dfe30cec1a0e194d20cca010f7a414abc
Author: Tyler Baker <tyler.baker@oss.qualcomm.com>
ASoC: soc-core: copy the DAI link names into the card
This commit duplicates the component DAI name onto the card device in
snd_soc_of_get_dai_link_codecs() and snd_soc_of_get_dai_link_cpus() so the
name remains valid across component unbind and rebind.
> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> index f33bece378b61..0e62965e35aaa 100644
> --- a/sound/soc/soc-core.c
> +++ b/sound/soc/soc-core.c
[ ... ]
> @@ -3282,6 +3294,8 @@ int snd_soc_of_get_dai_link_codecs(struct device *dev,
> /* Parse the list */
> for_each_link_codecs(dai_link, index, component) {
> ret = snd_soc_of_get_dlc(of_node, NULL, component, index);
> + if (!ret)
> + ret = snd_soc_of_dup_dai_name(dev, component);
> if (ret)
> goto err;
> }
[Severity: Medium]
This problem wasn't introduced by this patch, but does snd_soc_of_get_dlc()
[1] leak the device_node reference in args->np when snd_soc_get_dlc()
fails?
sound/soc/soc-core.c:snd_soc_of_get_dlc() {
if (!args)
args = &__args;
ret = of_parse_phandle_with_args(of_node, "sound-dai",
"#sound-dai-cells", index, args);
if (ret)
return ret;
return snd_soc_get_dlc(args, dlc);
}
of_parse_phandle_with_args() acquires a reference on args->np, which
snd_soc_get_dlc() only transfers to dlc->of_node on success. When
snd_soc_get_dlc() fails (for example with -EPROBE_DEFER) and the caller
passed a NULL args pointer as done here and in
snd_soc_of_get_dai_link_cpus(), __args goes out of scope without
of_node_put() being called.
[1] https://sashiko.dev/#/bug/linux-11ae6ad5-0cce-4928-9290-e7723e9f7638
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261106054333.2748248-1-tyler.baker@oss.qualcomm.com?part=1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] ASoC: qcom: x1e80100: recreate the headset jack on card rebind
2026-11-06 5:43 ` [PATCH 2/2] ASoC: qcom: x1e80100: recreate the headset jack on card rebind Tyler Baker
@ 2026-11-06 6:01 ` sashiko-bot
0 siblings, 0 replies; 6+ messages in thread
From: sashiko-bot @ 2026-11-06 6:01 UTC (permalink / raw)
To: Tyler Baker; +Cc: linux-sound
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] ASoC: qcom: x1e80100: missing DP jack cleanup in
x1e80100_snd_exit()
--
commit f605374e23a64b3505524d6591f1d001a229a2a3
Author: Tyler Baker <tyler.baker@oss.qualcomm.com>
ASoC: qcom: x1e80100: recreate the headset jack on card rebind
This commit adds a DAI link exit callback for x1e80100 to clean up the
headset jack and reset jack_setup on card unbind.
> diff --git a/sound/soc/qcom/x1e80100.c b/sound/soc/qcom/x1e80100.c
> index c81df41ace883..213d7f45198cb 100644
> --- a/sound/soc/qcom/x1e80100.c
> +++ b/sound/soc/qcom/x1e80100.c
> @@ -68,6 +68,23 @@ static int x1e80100_snd_init(struct snd_soc_pcm_runtime *rtd)
> return qcom_snd_wcd_jack_setup(rtd, &data->jack, &data->jack_setup);
> }
>
> +static void x1e80100_snd_exit(struct snd_soc_pcm_runtime *rtd)
> +{
> + struct x1e80100_snd_data *data = snd_soc_card_get_drvdata(rtd->card);
> + struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
> +
> + switch (cpu_dai->id) {
> + case DISPLAY_PORT_RX_0:
> + case DISPLAY_PORT_RX_1 ... DISPLAY_PORT_RX_7:
> + return;
> + default:
> + break;
> + }
[Severity: High]
Does returning early for DisplayPort links leave hdmi_codec_priv->jack
pointing to data->dp_jack[dp_pcm_id] after snd_card_free() frees its
underlying struct snd_jack?
On card rebind, snd_soc_bind_card() runs soc_probe_link_components()
before soc_init_pcm_runtime() calls x1e80100_snd_init() to recreate
dp_jack->jack. During soc_probe_link_components(), hdmi_probe() calls
drm_connector_hdmi_audio_hook_plugged_cb(), which synchronously invokes
hdmi_codec_jack_report():
sound/soc/codecs/hdmi-codec.c:hdmi_codec_jack_report() {
...
if (jack_status != hcp->jack_status) {
if (hcp->jack)
snd_soc_jack_report(hcp->jack, jack_status, SND_JACK_AVOUT);
hcp->jack_status = jack_status;
}
}
If the DisplayPort plug state changed while the card was unbound,
snd_soc_jack_report() dereferences the freed dp_jack->jack (use-after-free).
Calling qcom_snd_headset_jack_cleanup(rtd) before returning for the
DisplayPort links clears hcp->jack on unbind.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261106054333.2748248-1-tyler.baker@oss.qualcomm.com?part=2
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] ASoC: fix the x1e80100 card after an ADSP restart
2026-11-06 5:43 [PATCH 0/2] ASoC: fix the x1e80100 card after an ADSP restart Tyler Baker
2026-11-06 5:43 ` [PATCH 1/2] ASoC: soc-core: copy the DAI link names into the card Tyler Baker
2026-11-06 5:43 ` [PATCH 2/2] ASoC: qcom: x1e80100: recreate the headset jack on card rebind Tyler Baker
@ 2026-11-09 12:33 ` Mark Brown
2 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2026-11-09 12:33 UTC (permalink / raw)
To: Liam Girdwood, Tyler Baker
Cc: Srinivas Kandagatla, Kuninori Morimoto, Martin Povišer,
Krzysztof Kozlowski, Jaroslav Kysela, Takashi Iwai, linux-sound,
linux-arm-msm, linux-kernel
On Fri, 06 Nov 2026 00:43:31 -0500, Tyler Baker wrote:
> ASoC: fix the x1e80100 card after an ADSP restart
>
> On Qualcomm boards an ADSP restart unbinds and rebinds the LPASS pin
> controller, the SoundWire controllers and the codecs, and the card binds
> again once they are back. On the Hamoa IoT EVK two things break on that
> path: the DAI link names point at the SoundWire controllers' freed
> strings, and the headset jack is never recreated.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.4
Thanks!
[1/2] ASoC: soc-core: copy the DAI link names into the card
https://git.kernel.org/broonie/sound/c/33a130f6ed8c
[2/2] ASoC: qcom: x1e80100: recreate the headset jack on card rebind
https://git.kernel.org/broonie/sound/c/704251f9dad3
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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-11-09 19:43 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-06 5:43 [PATCH 0/2] ASoC: fix the x1e80100 card after an ADSP restart Tyler Baker
2026-11-06 5:43 ` [PATCH 1/2] ASoC: soc-core: copy the DAI link names into the card Tyler Baker
2026-11-06 5:52 ` sashiko-bot
2026-11-06 5:43 ` [PATCH 2/2] ASoC: qcom: x1e80100: recreate the headset jack on card rebind Tyler Baker
2026-11-06 6:01 ` sashiko-bot
2026-11-09 12:33 ` [PATCH 0/2] ASoC: fix the x1e80100 card after an ADSP restart Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox