mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [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
  2026-11-06  5:43 ` [PATCH 2/2] ASoC: qcom: x1e80100: recreate the headset jack on card rebind Tyler Baker
  0 siblings, 2 replies; 3+ 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] 3+ 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:43 ` [PATCH 2/2] ASoC: qcom: x1e80100: recreate the headset jack on card rebind Tyler Baker
  1 sibling, 0 replies; 3+ 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	[flat|nested] 3+ 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
  1 sibling, 0 replies; 3+ 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	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-06  5:43 UTC | newest]

Thread overview: 3+ 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:43 ` [PATCH 2/2] ASoC: qcom: x1e80100: recreate the headset jack on card rebind Tyler Baker

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®