[alsa-devel] [PATCH] ASoC: soc-core: don't use soc_find_component() at snd_soc_find_dai()
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
commit b9f2e25c599bb ("ASoC: soc-core: use soc_find_component() at snd_soc_find_dai()") used soc_find_component() at snd_soc_find_dai(), but, some CPU driver has CPU component for DAI and Platform component, for example generic DMAEngine component. In such case, CPU component and Platform component have same of_node / name.
Here soc_find_component() returns *1st* found component. Thus, we shouldn't use soc_find_component() at snd_soc_find_dai(). This patch fixup this it, and add comment to indicate this limitation.
Fixes: commit b9f2e25c599bb ("ASoC: soc-core: use soc_find_component() at snd_soc_find_dai()") Reported-by: Dmitry Osipenko digetx@gmail.com Reported-by: Jon Hunter jonathanh@nvidia.com Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/soc-core.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 358f1fb..8ccaf63 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -786,6 +786,14 @@ static struct snd_soc_component *soc_find_component(
lockdep_assert_held(&client_mutex);
+ /* + * NOTE + * + * It returns *1st* found component, but some driver + * has few components by same of_node/name + * ex) + * CPU component and generic DMAEngine component + */ for_each_component(component) if (snd_soc_is_matching_component(dlc, component)) return component; @@ -813,8 +821,9 @@ struct snd_soc_dai *snd_soc_find_dai( lockdep_assert_held(&client_mutex);
/* Find CPU DAI from registered DAIs */ - component = soc_find_component(dlc); - if (component) { + for_each_component(component) { + if (!snd_soc_is_matching_component(dlc, component)) + continue; for_each_component_dais(component, dai) { if (dlc->dai_name && strcmp(dai->name, dlc->dai_name) && (!dai->driver->name
26.06.2019 4:40, Kuninori Morimoto пишет:
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
commit b9f2e25c599bb ("ASoC: soc-core: use soc_find_component() at snd_soc_find_dai()") used soc_find_component() at snd_soc_find_dai(), but, some CPU driver has CPU component for DAI and Platform component, for example generic DMAEngine component. In such case, CPU component and Platform component have same of_node / name.
Here soc_find_component() returns *1st* found component. Thus, we shouldn't use soc_find_component() at snd_soc_find_dai(). This patch fixup this it, and add comment to indicate this limitation.
Fixes: commit b9f2e25c599bb ("ASoC: soc-core: use soc_find_component() at snd_soc_find_dai()") Reported-by: Dmitry Osipenko digetx@gmail.com Reported-by: Jon Hunter jonathanh@nvidia.com Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
sound/soc/soc-core.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 358f1fb..8ccaf63 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -786,6 +786,14 @@ static struct snd_soc_component *soc_find_component(
lockdep_assert_held(&client_mutex);
- /*
* NOTE
*
* It returns *1st* found component, but some driver
* has few components by same of_node/name
* ex)
* CPU component and generic DMAEngine component
for_each_component(component) if (snd_soc_is_matching_component(dlc, component)) return component;*/
@@ -813,8 +821,9 @@ struct snd_soc_dai *snd_soc_find_dai( lockdep_assert_held(&client_mutex);
/* Find CPU DAI from registered DAIs */
- component = soc_find_component(dlc);
- if (component) {
- for_each_component(component) {
if (!snd_soc_is_matching_component(dlc, component))
for_each_component_dais(component, dai) { if (dlc->dai_name && strcmp(dai->name, dlc->dai_name) && (!dai->driver->namecontinue;
Thank you very much!
Tested-by: Dmitry Osipenko digetx@gmail.com
On 26/06/2019 02:54, Dmitry Osipenko wrote:
26.06.2019 4:40, Kuninori Morimoto пишет:
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
commit b9f2e25c599bb ("ASoC: soc-core: use soc_find_component() at snd_soc_find_dai()") used soc_find_component() at snd_soc_find_dai(), but, some CPU driver has CPU component for DAI and Platform component, for example generic DMAEngine component. In such case, CPU component and Platform component have same of_node / name.
Here soc_find_component() returns *1st* found component. Thus, we shouldn't use soc_find_component() at snd_soc_find_dai(). This patch fixup this it, and add comment to indicate this limitation.
Fixes: commit b9f2e25c599bb ("ASoC: soc-core: use soc_find_component() at snd_soc_find_dai()") Reported-by: Dmitry Osipenko digetx@gmail.com Reported-by: Jon Hunter jonathanh@nvidia.com Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
sound/soc/soc-core.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 358f1fb..8ccaf63 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -786,6 +786,14 @@ static struct snd_soc_component *soc_find_component(
lockdep_assert_held(&client_mutex);
- /*
* NOTE
*
* It returns *1st* found component, but some driver
* has few components by same of_node/name
* ex)
* CPU component and generic DMAEngine component
for_each_component(component) if (snd_soc_is_matching_component(dlc, component)) return component;*/
@@ -813,8 +821,9 @@ struct snd_soc_dai *snd_soc_find_dai( lockdep_assert_held(&client_mutex);
/* Find CPU DAI from registered DAIs */
- component = soc_find_component(dlc);
- if (component) {
- for_each_component(component) {
if (!snd_soc_is_matching_component(dlc, component))
for_each_component_dais(component, dai) { if (dlc->dai_name && strcmp(dai->name, dlc->dai_name) && (!dai->driver->namecontinue;
Thank you very much!
Tested-by: Dmitry Osipenko digetx@gmail.com
Tested-by: Jon Hunter jonathanh@nvidia.com
Thanks! Jon
The patch
ASoC: soc-core: don't use soc_find_component() at snd_soc_find_dai()
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.3
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 e3303268f9cfa4eb7c2217df471417d4327109fd Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Date: Wed, 26 Jun 2019 10:40:59 +0900 Subject: [PATCH] ASoC: soc-core: don't use soc_find_component() at snd_soc_find_dai()
commit b9f2e25c599bb ("ASoC: soc-core: use soc_find_component() at snd_soc_find_dai()") used soc_find_component() at snd_soc_find_dai(), but, some CPU driver has CPU component for DAI and Platform component, for example generic DMAEngine component. In such case, CPU component and Platform component have same of_node / name.
Here soc_find_component() returns *1st* found component. Thus, we shouldn't use soc_find_component() at snd_soc_find_dai(). This patch fixup this it, and add comment to indicate this limitation.
Fixes: commit b9f2e25c599bb ("ASoC: soc-core: use soc_find_component() at snd_soc_find_dai()") Reported-by: Dmitry Osipenko digetx@gmail.com Reported-by: Jon Hunter jonathanh@nvidia.com Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Tested-by: Jon Hunter jonathanh@nvidia.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/soc-core.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 358f1fbf9a30..8ccaf63e428c 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -786,6 +786,14 @@ static struct snd_soc_component *soc_find_component(
lockdep_assert_held(&client_mutex);
+ /* + * NOTE + * + * It returns *1st* found component, but some driver + * has few components by same of_node/name + * ex) + * CPU component and generic DMAEngine component + */ for_each_component(component) if (snd_soc_is_matching_component(dlc, component)) return component; @@ -813,8 +821,9 @@ struct snd_soc_dai *snd_soc_find_dai( lockdep_assert_held(&client_mutex);
/* Find CPU DAI from registered DAIs */ - component = soc_find_component(dlc); - if (component) { + for_each_component(component) { + if (!snd_soc_is_matching_component(dlc, component)) + continue; for_each_component_dais(component, dai) { if (dlc->dai_name && strcmp(dai->name, dlc->dai_name) && (!dai->driver->name
participants (4)
-
Dmitry Osipenko
-
Jon Hunter
-
Kuninori Morimoto
-
Mark Brown