alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] ASoC: soc-core: disable checks on dapm_add_routes for legacy devices
@ 2020-03-09 19:27 Pierre-Louis Bossart
  2020-03-09 19:27 ` [PATCH 1/2] ASoC: soc-core: disable route checks " Pierre-Louis Bossart
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Pierre-Louis Bossart @ 2020-03-09 19:27 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, broonie, Pierre-Louis Bossart, Kuninori Morimoto

Since v5.4, the card probe ends when one or more DAPM routes cannot be
added. This is a good thing, but legacy devices have incomplete routes
that cannot practically be fixed by distributing a new topology file,
so users lose all audio functionality by updating their kernel.

Introduce an optional flag to allow for a backwards-compatible
behavior to keep supporting these devices. For now only set this flag
for the one device where an issue was reported. If desired, we could
set it for all SKL machine drivers by default.

Pierre-Louis Bossart (2):
  ASoC: soc-core: disable route checks for legacy devices
  ASoC: Intel: skl_nau88l25_ssm4567: disable route checks

 include/sound/soc.h                           |  1 +
 sound/soc/intel/boards/skl_nau88l25_ssm4567.c |  1 +
 sound/soc/soc-core.c                          | 28 ++++++++++++++++---
 3 files changed, 26 insertions(+), 4 deletions(-)

-- 
2.20.1


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

* [PATCH 1/2] ASoC: soc-core: disable route checks for legacy devices
  2020-03-09 19:27 [PATCH 0/2] ASoC: soc-core: disable checks on dapm_add_routes for legacy devices Pierre-Louis Bossart
@ 2020-03-09 19:27 ` Pierre-Louis Bossart
  2020-03-10 13:02   ` Applied "ASoC: soc-core: disable route checks for legacy devices" to the asoc tree Mark Brown
  2020-03-09 19:27 ` [PATCH 2/2] ASoC: Intel: skl_nau88l25_ssm4567: disable route checks Pierre-Louis Bossart
  2020-03-10  0:22 ` [PATCH 0/2] ASoC: soc-core: disable checks on dapm_add_routes for legacy devices Kuninori Morimoto
  2 siblings, 1 reply; 6+ messages in thread
From: Pierre-Louis Bossart @ 2020-03-09 19:27 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, broonie, Pierre-Louis Bossart, Kuninori Morimoto

v5.4 changes in soc-core tightened the checks on soc_dapm_add_routes,
which results in the ASoC card probe failing.

Introduce a flag to be set in machine drivers to prevent the probe
from stopping in case of incomplete topologies or missing routes. This
flag is for backwards compatibility only and shall not be used for
newer machine drivers.

Example with an HDaudio card with a bad topology:

[ 236.177898] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: Failed to
add route iDisp1_out -> direct -> iDisp1 Tx

[ 236.177902] skl_hda_dsp_generic skl_hda_dsp_generic:
snd_soc_bind_card: snd_soc_dapm_add_routes failed: -19

with the disable_route_checks set:

[ 64.031657] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: Failed to
add route iDisp1_out -> direct -> iDisp1 Tx

[ 64.031661] skl_hda_dsp_generic skl_hda_dsp_generic:
snd_soc_bind_card: disable_route_checks set, ignoring errors on
add_routes

Fixes: daa480bde6b3a9 ("ASoC: soc-core: tidyup for snd_soc_dapm_add_routes()")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 include/sound/soc.h  |  1 +
 sound/soc/soc-core.c | 28 ++++++++++++++++++++++++----
 2 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 81e5d17be935..96226036ddc2 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1063,6 +1063,7 @@ struct snd_soc_card {
 	const struct snd_soc_dapm_route *of_dapm_routes;
 	int num_of_dapm_routes;
 	bool fully_routed;
+	bool disable_route_checks;
 
 	/* lists of probed devices belonging to this card */
 	struct list_head component_dev_list;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index f2cfbf182f49..25eb2ef48e16 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1260,8 +1260,18 @@ static int soc_probe_component(struct snd_soc_card *card,
 	ret = snd_soc_dapm_add_routes(dapm,
 				      component->driver->dapm_routes,
 				      component->driver->num_dapm_routes);
-	if (ret < 0)
-		goto err_probe;
+	if (ret < 0) {
+		if (card->disable_route_checks) {
+			dev_info(card->dev,
+				 "%s: disable_route_checks set, ignoring errors on add_routes\n",
+				 __func__);
+		} else {
+			dev_err(card->dev,
+				"%s: snd_soc_dapm_add_routes failed: %d\n",
+				__func__, ret);
+			goto err_probe;
+		}
+	}
 
 	/* see for_each_card_components */
 	list_add(&component->card_list, &card->component_dev_list);
@@ -1948,8 +1958,18 @@ static int snd_soc_bind_card(struct snd_soc_card *card)
 
 	ret = snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes,
 				      card->num_dapm_routes);
-	if (ret < 0)
-		goto probe_end;
+	if (ret < 0) {
+		if (card->disable_route_checks) {
+			dev_info(card->dev,
+				 "%s: disable_route_checks set, ignoring errors on add_routes\n",
+				 __func__);
+		} else {
+			dev_err(card->dev,
+				 "%s: snd_soc_dapm_add_routes failed: %d\n",
+				 __func__, ret);
+			goto probe_end;
+		}
+	}
 
 	ret = snd_soc_dapm_add_routes(&card->dapm, card->of_dapm_routes,
 				      card->num_of_dapm_routes);
-- 
2.20.1


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

* [PATCH 2/2] ASoC: Intel: skl_nau88l25_ssm4567: disable route checks
  2020-03-09 19:27 [PATCH 0/2] ASoC: soc-core: disable checks on dapm_add_routes for legacy devices Pierre-Louis Bossart
  2020-03-09 19:27 ` [PATCH 1/2] ASoC: soc-core: disable route checks " Pierre-Louis Bossart
@ 2020-03-09 19:27 ` Pierre-Louis Bossart
  2020-03-10 13:02   ` Applied "ASoC: Intel: skl_nau88l25_ssm4567: disable route checks" to the asoc tree Mark Brown
  2020-03-10  0:22 ` [PATCH 0/2] ASoC: soc-core: disable checks on dapm_add_routes for legacy devices Kuninori Morimoto
  2 siblings, 1 reply; 6+ messages in thread
From: Pierre-Louis Bossart @ 2020-03-09 19:27 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, broonie, Pierre-Louis Bossart, Kuninori Morimoto, ojab //

Deal with incomplete topologies, this patch restores sound on user
devices.

Tested-by: ojab // <ojab@ojab.ru>
Fixes: daa480bde6b3a9 ("ASoC: soc-core: tidyup for snd_soc_dapm_add_routes()")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/boards/skl_nau88l25_ssm4567.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/intel/boards/skl_nau88l25_ssm4567.c b/sound/soc/intel/boards/skl_nau88l25_ssm4567.c
index 6f68712ffce9..40f8eb53e822 100644
--- a/sound/soc/intel/boards/skl_nau88l25_ssm4567.c
+++ b/sound/soc/intel/boards/skl_nau88l25_ssm4567.c
@@ -686,6 +686,7 @@ static struct snd_soc_card skylake_audio_card = {
 	.codec_conf = ssm4567_codec_conf,
 	.num_configs = ARRAY_SIZE(ssm4567_codec_conf),
 	.fully_routed = true,
+	.disable_route_checks = true,
 	.late_probe = skylake_card_late_probe,
 };
 
-- 
2.20.1


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

* Re: [PATCH 0/2] ASoC: soc-core: disable checks on dapm_add_routes for legacy devices
  2020-03-09 19:27 [PATCH 0/2] ASoC: soc-core: disable checks on dapm_add_routes for legacy devices Pierre-Louis Bossart
  2020-03-09 19:27 ` [PATCH 1/2] ASoC: soc-core: disable route checks " Pierre-Louis Bossart
  2020-03-09 19:27 ` [PATCH 2/2] ASoC: Intel: skl_nau88l25_ssm4567: disable route checks Pierre-Louis Bossart
@ 2020-03-10  0:22 ` Kuninori Morimoto
  2 siblings, 0 replies; 6+ messages in thread
From: Kuninori Morimoto @ 2020-03-10  0:22 UTC (permalink / raw)
  To: Pierre-Louis Bossart; +Cc: tiwai, alsa-devel, broonie


Hi Pierre-Louis

> Since v5.4, the card probe ends when one or more DAPM routes cannot be
> added. This is a good thing, but legacy devices have incomplete routes
> that cannot practically be fixed by distributing a new topology file,
> so users lose all audio functionality by updating their kernel.
> 
> Introduce an optional flag to allow for a backwards-compatible
> behavior to keep supporting these devices. For now only set this flag
> for the one device where an issue was reported. If desired, we could
> set it for all SKL machine drivers by default.
> 
> Pierre-Louis Bossart (2):
>   ASoC: soc-core: disable route checks for legacy devices
>   ASoC: Intel: skl_nau88l25_ssm4567: disable route checks

Thank you for your patch.

Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>


Thank you for your help !!

Best regards
---
Kuninori Morimoto

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

* Applied "ASoC: Intel: skl_nau88l25_ssm4567: disable route checks" to the asoc tree
  2020-03-09 19:27 ` [PATCH 2/2] ASoC: Intel: skl_nau88l25_ssm4567: disable route checks Pierre-Louis Bossart
@ 2020-03-10 13:02   ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2020-03-10 13:02 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: tiwai, alsa-devel, Mark Brown, ojab //, Kuninori Morimoto

The patch

   ASoC: Intel: skl_nau88l25_ssm4567: disable route checks

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

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

From c8061689ffadde941f9c3756f1362bd2b97311c8 Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Date: Mon, 9 Mar 2020 14:27:44 -0500
Subject: [PATCH] ASoC: Intel: skl_nau88l25_ssm4567: disable route checks

Deal with incomplete topologies, this patch restores sound on user
devices.

Fixes: daa480bde6b3a9 ("ASoC: soc-core: tidyup for snd_soc_dapm_add_routes()")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tested-by: ojab // <ojab@ojab.ru>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20200309192744.18380-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/boards/skl_nau88l25_ssm4567.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/intel/boards/skl_nau88l25_ssm4567.c b/sound/soc/intel/boards/skl_nau88l25_ssm4567.c
index c99c8b23e509..b3b835156d77 100644
--- a/sound/soc/intel/boards/skl_nau88l25_ssm4567.c
+++ b/sound/soc/intel/boards/skl_nau88l25_ssm4567.c
@@ -686,6 +686,7 @@ static struct snd_soc_card skylake_audio_card = {
 	.codec_conf = ssm4567_codec_conf,
 	.num_configs = ARRAY_SIZE(ssm4567_codec_conf),
 	.fully_routed = true,
+	.disable_route_checks = true,
 	.late_probe = skylake_card_late_probe,
 };
 
-- 
2.20.1


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

* Applied "ASoC: soc-core: disable route checks for legacy devices" to the asoc tree
  2020-03-09 19:27 ` [PATCH 1/2] ASoC: soc-core: disable route checks " Pierre-Louis Bossart
@ 2020-03-10 13:02   ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2020-03-10 13:02 UTC (permalink / raw)
  To: Pierre-Louis Bossart; +Cc: tiwai, alsa-devel, Mark Brown, Kuninori Morimoto

The patch

   ASoC: soc-core: disable route checks for legacy devices

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

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

From a22ae72b86a4f754e8d25fbf9ea5a8f77365e531 Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Date: Mon, 9 Mar 2020 14:27:43 -0500
Subject: [PATCH] ASoC: soc-core: disable route checks for legacy devices

v5.4 changes in soc-core tightened the checks on soc_dapm_add_routes,
which results in the ASoC card probe failing.

Introduce a flag to be set in machine drivers to prevent the probe
from stopping in case of incomplete topologies or missing routes. This
flag is for backwards compatibility only and shall not be used for
newer machine drivers.

Example with an HDaudio card with a bad topology:

[ 236.177898] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: Failed to
add route iDisp1_out -> direct -> iDisp1 Tx

[ 236.177902] skl_hda_dsp_generic skl_hda_dsp_generic:
snd_soc_bind_card: snd_soc_dapm_add_routes failed: -19

with the disable_route_checks set:

[ 64.031657] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: Failed to
add route iDisp1_out -> direct -> iDisp1 Tx

[ 64.031661] skl_hda_dsp_generic skl_hda_dsp_generic:
snd_soc_bind_card: disable_route_checks set, ignoring errors on
add_routes

Fixes: daa480bde6b3a9 ("ASoC: soc-core: tidyup for snd_soc_dapm_add_routes()")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20200309192744.18380-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 include/sound/soc.h  |  1 +
 sound/soc/soc-core.c | 28 ++++++++++++++++++++++++----
 2 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 8a2266676b2d..efb8bad7b0fa 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1058,6 +1058,7 @@ struct snd_soc_card {
 	const struct snd_soc_dapm_route *of_dapm_routes;
 	int num_of_dapm_routes;
 	bool fully_routed;
+	bool disable_route_checks;
 
 	/* lists of probed devices belonging to this card */
 	struct list_head component_dev_list;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 068d809c349a..b17366bac846 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1256,8 +1256,18 @@ static int soc_probe_component(struct snd_soc_card *card,
 	ret = snd_soc_dapm_add_routes(dapm,
 				      component->driver->dapm_routes,
 				      component->driver->num_dapm_routes);
-	if (ret < 0)
-		goto err_probe;
+	if (ret < 0) {
+		if (card->disable_route_checks) {
+			dev_info(card->dev,
+				 "%s: disable_route_checks set, ignoring errors on add_routes\n",
+				 __func__);
+		} else {
+			dev_err(card->dev,
+				"%s: snd_soc_dapm_add_routes failed: %d\n",
+				__func__, ret);
+			goto err_probe;
+		}
+	}
 
 	/* see for_each_card_components */
 	list_add(&component->card_list, &card->component_dev_list);
@@ -1938,8 +1948,18 @@ static int snd_soc_bind_card(struct snd_soc_card *card)
 
 	ret = snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes,
 				      card->num_dapm_routes);
-	if (ret < 0)
-		goto probe_end;
+	if (ret < 0) {
+		if (card->disable_route_checks) {
+			dev_info(card->dev,
+				 "%s: disable_route_checks set, ignoring errors on add_routes\n",
+				 __func__);
+		} else {
+			dev_err(card->dev,
+				 "%s: snd_soc_dapm_add_routes failed: %d\n",
+				 __func__, ret);
+			goto probe_end;
+		}
+	}
 
 	ret = snd_soc_dapm_add_routes(&card->dapm, card->of_dapm_routes,
 				      card->num_of_dapm_routes);
-- 
2.20.1


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

end of thread, other threads:[~2020-03-10 13:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-09 19:27 [PATCH 0/2] ASoC: soc-core: disable checks on dapm_add_routes for legacy devices Pierre-Louis Bossart
2020-03-09 19:27 ` [PATCH 1/2] ASoC: soc-core: disable route checks " Pierre-Louis Bossart
2020-03-10 13:02   ` Applied "ASoC: soc-core: disable route checks for legacy devices" to the asoc tree Mark Brown
2020-03-09 19:27 ` [PATCH 2/2] ASoC: Intel: skl_nau88l25_ssm4567: disable route checks Pierre-Louis Bossart
2020-03-10 13:02   ` Applied "ASoC: Intel: skl_nau88l25_ssm4567: disable route checks" to the asoc tree Mark Brown
2020-03-10  0:22 ` [PATCH 0/2] ASoC: soc-core: disable checks on dapm_add_routes for legacy devices Kuninori Morimoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).