* [PATCH] ASoC: topology: fix soc_tplg_fe_link_create() - link->dobj initialization order
@ 2020-01-22 19:07 ` Jaroslav Kysela
0 siblings, 0 replies; 14+ messages in thread
From: Jaroslav Kysela @ 2020-01-22 19:07 UTC (permalink / raw)
To: ALSA development
Cc: Takashi Iwai, Jaroslav Kysela, Dragos Tarcatu,
Pierre-Louis Bossart, Ranjani Sridharan, Mark Brown, stable
The code which checks the return value for snd_soc_add_dai_link() call
in soc_tplg_fe_link_create() moved the snd_soc_add_dai_link() call before
link->dobj members initialization.
While it does not affect the latest kernels, the old soc-core.c code
in the stable kernels is affected. The snd_soc_add_dai_link() function uses
the link->dobj.type member to check, if the link structure is valid.
Reorder the link->dobj initialization to make things work again.
It's harmless for the recent code (and the structure should be properly
initialized before other calls anyway).
The problem is in stable linux-5.4.y since version 5.4.11 when the
upstream commit 76d270364932 was applied.
Fixes: 76d270364932 ("ASoC: topology: Check return value for snd_soc_add_dai_link()")
Cc: Dragos Tarcatu <dragos_tarcatu@mentor.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
sound/soc/soc-topology.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index 92e4f4d08bfa..4e1fe623c390 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -1906,6 +1906,10 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg,
link->num_codecs = 1;
link->num_platforms = 1;
+ link->dobj.index = tplg->index;
+ link->dobj.ops = tplg->ops;
+ link->dobj.type = SND_SOC_DOBJ_DAI_LINK;
+
if (strlen(pcm->pcm_name)) {
link->name = kstrdup(pcm->pcm_name, GFP_KERNEL);
link->stream_name = kstrdup(pcm->pcm_name, GFP_KERNEL);
@@ -1942,9 +1946,6 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg,
goto err;
}
- link->dobj.index = tplg->index;
- link->dobj.ops = tplg->ops;
- link->dobj.type = SND_SOC_DOBJ_DAI_LINK;
list_add(&link->dobj.list, &tplg->comp->dobj_list);
return 0;
--
2.24.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [alsa-devel] [PATCH] ASoC: topology: fix soc_tplg_fe_link_create() - link->dobj initialization order
@ 2020-01-22 19:07 ` Jaroslav Kysela
0 siblings, 0 replies; 14+ messages in thread
From: Jaroslav Kysela @ 2020-01-22 19:07 UTC (permalink / raw)
To: ALSA development
Cc: Dragos Tarcatu, Takashi Iwai, Ranjani Sridharan, stable,
Pierre-Louis Bossart, Mark Brown
The code which checks the return value for snd_soc_add_dai_link() call
in soc_tplg_fe_link_create() moved the snd_soc_add_dai_link() call before
link->dobj members initialization.
While it does not affect the latest kernels, the old soc-core.c code
in the stable kernels is affected. The snd_soc_add_dai_link() function uses
the link->dobj.type member to check, if the link structure is valid.
Reorder the link->dobj initialization to make things work again.
It's harmless for the recent code (and the structure should be properly
initialized before other calls anyway).
The problem is in stable linux-5.4.y since version 5.4.11 when the
upstream commit 76d270364932 was applied.
Fixes: 76d270364932 ("ASoC: topology: Check return value for snd_soc_add_dai_link()")
Cc: Dragos Tarcatu <dragos_tarcatu@mentor.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
sound/soc/soc-topology.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index 92e4f4d08bfa..4e1fe623c390 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -1906,6 +1906,10 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg,
link->num_codecs = 1;
link->num_platforms = 1;
+ link->dobj.index = tplg->index;
+ link->dobj.ops = tplg->ops;
+ link->dobj.type = SND_SOC_DOBJ_DAI_LINK;
+
if (strlen(pcm->pcm_name)) {
link->name = kstrdup(pcm->pcm_name, GFP_KERNEL);
link->stream_name = kstrdup(pcm->pcm_name, GFP_KERNEL);
@@ -1942,9 +1946,6 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg,
goto err;
}
- link->dobj.index = tplg->index;
- link->dobj.ops = tplg->ops;
- link->dobj.type = SND_SOC_DOBJ_DAI_LINK;
list_add(&link->dobj.list, &tplg->comp->dobj_list);
return 0;
--
2.24.1
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [alsa-devel] [PATCH] ASoC: topology: fix soc_tplg_fe_link_create() - link->dobj initialization order
2020-01-22 19:07 ` [alsa-devel] " Jaroslav Kysela
@ 2020-01-22 19:28 ` Pierre-Louis Bossart
-1 siblings, 0 replies; 14+ messages in thread
From: Pierre-Louis Bossart @ 2020-01-22 19:28 UTC (permalink / raw)
To: Jaroslav Kysela, ALSA development
Cc: Dragos Tarcatu, Takashi Iwai, Ranjani Sridharan, stable, Mark Brown
On 1/22/20 1:07 PM, Jaroslav Kysela wrote:
> The code which checks the return value for snd_soc_add_dai_link() call
> in soc_tplg_fe_link_create() moved the snd_soc_add_dai_link() call before
> link->dobj members initialization.
>
> While it does not affect the latest kernels, the old soc-core.c code
> in the stable kernels is affected. The snd_soc_add_dai_link() function uses
> the link->dobj.type member to check, if the link structure is valid.
>
> Reorder the link->dobj initialization to make things work again.
> It's harmless for the recent code (and the structure should be properly
> initialized before other calls anyway).
>
> The problem is in stable linux-5.4.y since version 5.4.11 when the
> upstream commit 76d270364932 was applied.
I am not following. Is this a fix for linux-5.4-y only, or is it needed
on Mark's tree? In the latter case, what is broken? We've been using
Mark's tree without issues, wondering what we missed?
>
> Fixes: 76d270364932 ("ASoC: topology: Check return value for snd_soc_add_dai_link()")
> Cc: Dragos Tarcatu <dragos_tarcatu@mentor.com>
> Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Cc: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
> Cc: Mark Brown <broonie@kernel.org>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
> ---
> sound/soc/soc-topology.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
> index 92e4f4d08bfa..4e1fe623c390 100644
> --- a/sound/soc/soc-topology.c
> +++ b/sound/soc/soc-topology.c
> @@ -1906,6 +1906,10 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg,
> link->num_codecs = 1;
> link->num_platforms = 1;
>
> + link->dobj.index = tplg->index;
> + link->dobj.ops = tplg->ops;
> + link->dobj.type = SND_SOC_DOBJ_DAI_LINK;
> +
> if (strlen(pcm->pcm_name)) {
> link->name = kstrdup(pcm->pcm_name, GFP_KERNEL);
> link->stream_name = kstrdup(pcm->pcm_name, GFP_KERNEL);
> @@ -1942,9 +1946,6 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg,
> goto err;
> }
>
> - link->dobj.index = tplg->index;
> - link->dobj.ops = tplg->ops;
> - link->dobj.type = SND_SOC_DOBJ_DAI_LINK;
> list_add(&link->dobj.list, &tplg->comp->dobj_list);
>
> return 0;
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [alsa-devel] [PATCH] ASoC: topology: fix soc_tplg_fe_link_create() - link->dobj initialization order
@ 2020-01-22 19:28 ` Pierre-Louis Bossart
0 siblings, 0 replies; 14+ messages in thread
From: Pierre-Louis Bossart @ 2020-01-22 19:28 UTC (permalink / raw)
To: Jaroslav Kysela, ALSA development
Cc: Dragos Tarcatu, Takashi Iwai, Mark Brown, Ranjani Sridharan, stable
On 1/22/20 1:07 PM, Jaroslav Kysela wrote:
> The code which checks the return value for snd_soc_add_dai_link() call
> in soc_tplg_fe_link_create() moved the snd_soc_add_dai_link() call before
> link->dobj members initialization.
>
> While it does not affect the latest kernels, the old soc-core.c code
> in the stable kernels is affected. The snd_soc_add_dai_link() function uses
> the link->dobj.type member to check, if the link structure is valid.
>
> Reorder the link->dobj initialization to make things work again.
> It's harmless for the recent code (and the structure should be properly
> initialized before other calls anyway).
>
> The problem is in stable linux-5.4.y since version 5.4.11 when the
> upstream commit 76d270364932 was applied.
I am not following. Is this a fix for linux-5.4-y only, or is it needed
on Mark's tree? In the latter case, what is broken? We've been using
Mark's tree without issues, wondering what we missed?
>
> Fixes: 76d270364932 ("ASoC: topology: Check return value for snd_soc_add_dai_link()")
> Cc: Dragos Tarcatu <dragos_tarcatu@mentor.com>
> Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Cc: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
> Cc: Mark Brown <broonie@kernel.org>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
> ---
> sound/soc/soc-topology.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
> index 92e4f4d08bfa..4e1fe623c390 100644
> --- a/sound/soc/soc-topology.c
> +++ b/sound/soc/soc-topology.c
> @@ -1906,6 +1906,10 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg,
> link->num_codecs = 1;
> link->num_platforms = 1;
>
> + link->dobj.index = tplg->index;
> + link->dobj.ops = tplg->ops;
> + link->dobj.type = SND_SOC_DOBJ_DAI_LINK;
> +
> if (strlen(pcm->pcm_name)) {
> link->name = kstrdup(pcm->pcm_name, GFP_KERNEL);
> link->stream_name = kstrdup(pcm->pcm_name, GFP_KERNEL);
> @@ -1942,9 +1946,6 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg,
> goto err;
> }
>
> - link->dobj.index = tplg->index;
> - link->dobj.ops = tplg->ops;
> - link->dobj.type = SND_SOC_DOBJ_DAI_LINK;
> list_add(&link->dobj.list, &tplg->comp->dobj_list);
>
> return 0;
>
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [alsa-devel] [PATCH] ASoC: topology: fix soc_tplg_fe_link_create() - link->dobj initialization order
2020-01-22 19:28 ` Pierre-Louis Bossart
@ 2020-01-22 20:25 ` Mark Brown
-1 siblings, 0 replies; 14+ messages in thread
From: Mark Brown @ 2020-01-22 20:25 UTC (permalink / raw)
To: Pierre-Louis Bossart
Cc: Jaroslav Kysela, ALSA development, Dragos Tarcatu, Takashi Iwai,
Ranjani Sridharan, stable, Sasha Levin, Greg Kroah-Hartman
[-- Attachment #1: Type: text/plain, Size: 1404 bytes --]
On Wed, Jan 22, 2020 at 01:28:57PM -0600, Pierre-Louis Bossart wrote:
> On 1/22/20 1:07 PM, Jaroslav Kysela wrote:
> > The code which checks the return value for snd_soc_add_dai_link() call
> > in soc_tplg_fe_link_create() moved the snd_soc_add_dai_link() call before
> > link->dobj members initialization.
> > While it does not affect the latest kernels, the old soc-core.c code
> > in the stable kernels is affected. The snd_soc_add_dai_link() function uses
> > the link->dobj.type member to check, if the link structure is valid.
> > Reorder the link->dobj initialization to make things work again.
> > It's harmless for the recent code (and the structure should be properly
> > initialized before other calls anyway).
> > The problem is in stable linux-5.4.y since version 5.4.11 when the
> > upstream commit 76d270364932 was applied.
> I am not following. Is this a fix for linux-5.4-y only, or is it needed on
> Mark's tree? In the latter case, what is broken? We've been using Mark's
> tree without issues, wondering what we missed?
He's saying it's a fix for stable but it's just a cleanup and robustness
improvement in current kernels - when the patch 76d270364932 (ASoC:
topology: Check return value for snd_soc_add_dai_link()) was backported
by the bot the bot missed some other context which triggered bugs.
Copying in Sasha and Greg for stable (not sure if the list works by
itself).
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [alsa-devel] [PATCH] ASoC: topology: fix soc_tplg_fe_link_create() - link->dobj initialization order
@ 2020-01-22 20:25 ` Mark Brown
0 siblings, 0 replies; 14+ messages in thread
From: Mark Brown @ 2020-01-22 20:25 UTC (permalink / raw)
To: Pierre-Louis Bossart
Cc: Dragos Tarcatu, Sasha Levin, ALSA development, Takashi Iwai,
Greg Kroah-Hartman, Ranjani Sridharan, stable
[-- Attachment #1.1: Type: text/plain, Size: 1404 bytes --]
On Wed, Jan 22, 2020 at 01:28:57PM -0600, Pierre-Louis Bossart wrote:
> On 1/22/20 1:07 PM, Jaroslav Kysela wrote:
> > The code which checks the return value for snd_soc_add_dai_link() call
> > in soc_tplg_fe_link_create() moved the snd_soc_add_dai_link() call before
> > link->dobj members initialization.
> > While it does not affect the latest kernels, the old soc-core.c code
> > in the stable kernels is affected. The snd_soc_add_dai_link() function uses
> > the link->dobj.type member to check, if the link structure is valid.
> > Reorder the link->dobj initialization to make things work again.
> > It's harmless for the recent code (and the structure should be properly
> > initialized before other calls anyway).
> > The problem is in stable linux-5.4.y since version 5.4.11 when the
> > upstream commit 76d270364932 was applied.
> I am not following. Is this a fix for linux-5.4-y only, or is it needed on
> Mark's tree? In the latter case, what is broken? We've been using Mark's
> tree without issues, wondering what we missed?
He's saying it's a fix for stable but it's just a cleanup and robustness
improvement in current kernels - when the patch 76d270364932 (ASoC:
topology: Check return value for snd_soc_add_dai_link()) was backported
by the bot the bot missed some other context which triggered bugs.
Copying in Sasha and Greg for stable (not sure if the list works by
itself).
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 161 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [alsa-devel] [PATCH] ASoC: topology: fix soc_tplg_fe_link_create() - link->dobj initialization order
2020-01-22 20:25 ` Mark Brown
@ 2020-01-22 20:49 ` Jaroslav Kysela
-1 siblings, 0 replies; 14+ messages in thread
From: Jaroslav Kysela @ 2020-01-22 20:49 UTC (permalink / raw)
To: Mark Brown, Pierre-Louis Bossart
Cc: ALSA development, Dragos Tarcatu, Takashi Iwai,
Ranjani Sridharan, stable, Sasha Levin, Greg Kroah-Hartman
Dne 22. 01. 20 v 21:25 Mark Brown napsal(a):
> On Wed, Jan 22, 2020 at 01:28:57PM -0600, Pierre-Louis Bossart wrote:
>> On 1/22/20 1:07 PM, Jaroslav Kysela wrote:
>
>>> The code which checks the return value for snd_soc_add_dai_link() call
>>> in soc_tplg_fe_link_create() moved the snd_soc_add_dai_link() call before
>>> link->dobj members initialization.
>
>>> While it does not affect the latest kernels, the old soc-core.c code
>>> in the stable kernels is affected. The snd_soc_add_dai_link() function uses
>>> the link->dobj.type member to check, if the link structure is valid.
>
>>> Reorder the link->dobj initialization to make things work again.
>>> It's harmless for the recent code (and the structure should be properly
>>> initialized before other calls anyway).
>
>>> The problem is in stable linux-5.4.y since version 5.4.11 when the
>>> upstream commit 76d270364932 was applied.
>
>> I am not following. Is this a fix for linux-5.4-y only, or is it needed on
>> Mark's tree? In the latter case, what is broken? We've been using Mark's
>> tree without issues, wondering what we missed?
>
> He's saying it's a fix for stable but it's just a cleanup and robustness
> improvement in current kernels - when the patch 76d270364932 (ASoC:
> topology: Check return value for snd_soc_add_dai_link()) was backported
> by the bot the bot missed some other context which triggered bugs.
Exactly. It's because the commit 237d19080cd37e1ccf5462e63d8577d713f6da46
("ASoC: soc-core: remove topology specific operation") removed the link->dobj
checks, but this commit was not picked to the stable kernels.
The initialization reordering is fine for all kernels (and makes sense), so I
would like to apply it everywhere.
Thanks,
Jaroslav
--
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [alsa-devel] [PATCH] ASoC: topology: fix soc_tplg_fe_link_create() - link->dobj initialization order
@ 2020-01-22 20:49 ` Jaroslav Kysela
0 siblings, 0 replies; 14+ messages in thread
From: Jaroslav Kysela @ 2020-01-22 20:49 UTC (permalink / raw)
To: Mark Brown, Pierre-Louis Bossart
Cc: Dragos Tarcatu, Sasha Levin, ALSA development, Takashi Iwai,
Greg Kroah-Hartman, Ranjani Sridharan, stable
Dne 22. 01. 20 v 21:25 Mark Brown napsal(a):
> On Wed, Jan 22, 2020 at 01:28:57PM -0600, Pierre-Louis Bossart wrote:
>> On 1/22/20 1:07 PM, Jaroslav Kysela wrote:
>
>>> The code which checks the return value for snd_soc_add_dai_link() call
>>> in soc_tplg_fe_link_create() moved the snd_soc_add_dai_link() call before
>>> link->dobj members initialization.
>
>>> While it does not affect the latest kernels, the old soc-core.c code
>>> in the stable kernels is affected. The snd_soc_add_dai_link() function uses
>>> the link->dobj.type member to check, if the link structure is valid.
>
>>> Reorder the link->dobj initialization to make things work again.
>>> It's harmless for the recent code (and the structure should be properly
>>> initialized before other calls anyway).
>
>>> The problem is in stable linux-5.4.y since version 5.4.11 when the
>>> upstream commit 76d270364932 was applied.
>
>> I am not following. Is this a fix for linux-5.4-y only, or is it needed on
>> Mark's tree? In the latter case, what is broken? We've been using Mark's
>> tree without issues, wondering what we missed?
>
> He's saying it's a fix for stable but it's just a cleanup and robustness
> improvement in current kernels - when the patch 76d270364932 (ASoC:
> topology: Check return value for snd_soc_add_dai_link()) was backported
> by the bot the bot missed some other context which triggered bugs.
Exactly. It's because the commit 237d19080cd37e1ccf5462e63d8577d713f6da46
("ASoC: soc-core: remove topology specific operation") removed the link->dobj
checks, but this commit was not picked to the stable kernels.
The initialization reordering is fine for all kernels (and makes sense), so I
would like to apply it everywhere.
Thanks,
Jaroslav
--
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [alsa-devel] [PATCH] ASoC: topology: fix soc_tplg_fe_link_create() - link->dobj initialization order
2020-01-22 20:49 ` Jaroslav Kysela
@ 2020-01-22 21:47 ` Pierre-Louis Bossart
-1 siblings, 0 replies; 14+ messages in thread
From: Pierre-Louis Bossart @ 2020-01-22 21:47 UTC (permalink / raw)
To: Jaroslav Kysela, Mark Brown
Cc: Dragos Tarcatu, Sasha Levin, ALSA development, Takashi Iwai,
Greg Kroah-Hartman, Ranjani Sridharan, stable
>>> I am not following. Is this a fix for linux-5.4-y only, or is it
>>> needed on
>>> Mark's tree? In the latter case, what is broken? We've been using Mark's
>>> tree without issues, wondering what we missed?
>>
>> He's saying it's a fix for stable but it's just a cleanup and robustness
>> improvement in current kernels - when the patch 76d270364932 (ASoC:
>> topology: Check return value for snd_soc_add_dai_link()) was backported
>> by the bot the bot missed some other context which triggered bugs.
>
> Exactly. It's because the commit
> 237d19080cd37e1ccf5462e63d8577d713f6da46 ("ASoC: soc-core: remove
> topology specific operation") removed the link->dobj checks, but this
> commit was not picked to the stable kernels.
>
> The initialization reordering is fine for all kernels (and makes sense),
> so I would like to apply it everywhere.
ok, thanks for the precisions.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [alsa-devel] [PATCH] ASoC: topology: fix soc_tplg_fe_link_create() - link->dobj initialization order
@ 2020-01-22 21:47 ` Pierre-Louis Bossart
0 siblings, 0 replies; 14+ messages in thread
From: Pierre-Louis Bossart @ 2020-01-22 21:47 UTC (permalink / raw)
To: Jaroslav Kysela, Mark Brown
Cc: Dragos Tarcatu, Sasha Levin, ALSA development, Takashi Iwai,
Greg Kroah-Hartman, Ranjani Sridharan, stable
>>> I am not following. Is this a fix for linux-5.4-y only, or is it
>>> needed on
>>> Mark's tree? In the latter case, what is broken? We've been using Mark's
>>> tree without issues, wondering what we missed?
>>
>> He's saying it's a fix for stable but it's just a cleanup and robustness
>> improvement in current kernels - when the patch 76d270364932 (ASoC:
>> topology: Check return value for snd_soc_add_dai_link()) was backported
>> by the bot the bot missed some other context which triggered bugs.
>
> Exactly. It's because the commit
> 237d19080cd37e1ccf5462e63d8577d713f6da46 ("ASoC: soc-core: remove
> topology specific operation") removed the link->dobj checks, but this
> commit was not picked to the stable kernels.
>
> The initialization reordering is fine for all kernels (and makes sense),
> so I would like to apply it everywhere.
ok, thanks for the precisions.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [alsa-devel] [PATCH] ASoC: topology: fix soc_tplg_fe_link_create() - link->dobj initialization order
2020-01-22 20:25 ` Mark Brown
@ 2020-01-23 6:43 ` Greg Kroah-Hartman
-1 siblings, 0 replies; 14+ messages in thread
From: Greg Kroah-Hartman @ 2020-01-23 6:43 UTC (permalink / raw)
To: Mark Brown
Cc: Pierre-Louis Bossart, Jaroslav Kysela, ALSA development,
Dragos Tarcatu, Takashi Iwai, Ranjani Sridharan, stable,
Sasha Levin
On Wed, Jan 22, 2020 at 08:25:30PM +0000, Mark Brown wrote:
> On Wed, Jan 22, 2020 at 01:28:57PM -0600, Pierre-Louis Bossart wrote:
> > On 1/22/20 1:07 PM, Jaroslav Kysela wrote:
>
> > > The code which checks the return value for snd_soc_add_dai_link() call
> > > in soc_tplg_fe_link_create() moved the snd_soc_add_dai_link() call before
> > > link->dobj members initialization.
>
> > > While it does not affect the latest kernels, the old soc-core.c code
> > > in the stable kernels is affected. The snd_soc_add_dai_link() function uses
> > > the link->dobj.type member to check, if the link structure is valid.
>
> > > Reorder the link->dobj initialization to make things work again.
> > > It's harmless for the recent code (and the structure should be properly
> > > initialized before other calls anyway).
>
> > > The problem is in stable linux-5.4.y since version 5.4.11 when the
> > > upstream commit 76d270364932 was applied.
>
> > I am not following. Is this a fix for linux-5.4-y only, or is it needed on
> > Mark's tree? In the latter case, what is broken? We've been using Mark's
> > tree without issues, wondering what we missed?
>
> He's saying it's a fix for stable but it's just a cleanup and robustness
> improvement in current kernels - when the patch 76d270364932 (ASoC:
> topology: Check return value for snd_soc_add_dai_link()) was backported
> by the bot the bot missed some other context which triggered bugs.
>
> Copying in Sasha and Greg for stable (not sure if the list works by
> itself).
How this was marked-up is fine, our scripts can easily handle it,
thanks.
greg k-h
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [alsa-devel] [PATCH] ASoC: topology: fix soc_tplg_fe_link_create() - link->dobj initialization order
@ 2020-01-23 6:43 ` Greg Kroah-Hartman
0 siblings, 0 replies; 14+ messages in thread
From: Greg Kroah-Hartman @ 2020-01-23 6:43 UTC (permalink / raw)
To: Mark Brown
Cc: Dragos Tarcatu, Sasha Levin, ALSA development, Takashi Iwai,
Ranjani Sridharan, stable, Pierre-Louis Bossart
On Wed, Jan 22, 2020 at 08:25:30PM +0000, Mark Brown wrote:
> On Wed, Jan 22, 2020 at 01:28:57PM -0600, Pierre-Louis Bossart wrote:
> > On 1/22/20 1:07 PM, Jaroslav Kysela wrote:
>
> > > The code which checks the return value for snd_soc_add_dai_link() call
> > > in soc_tplg_fe_link_create() moved the snd_soc_add_dai_link() call before
> > > link->dobj members initialization.
>
> > > While it does not affect the latest kernels, the old soc-core.c code
> > > in the stable kernels is affected. The snd_soc_add_dai_link() function uses
> > > the link->dobj.type member to check, if the link structure is valid.
>
> > > Reorder the link->dobj initialization to make things work again.
> > > It's harmless for the recent code (and the structure should be properly
> > > initialized before other calls anyway).
>
> > > The problem is in stable linux-5.4.y since version 5.4.11 when the
> > > upstream commit 76d270364932 was applied.
>
> > I am not following. Is this a fix for linux-5.4-y only, or is it needed on
> > Mark's tree? In the latter case, what is broken? We've been using Mark's
> > tree without issues, wondering what we missed?
>
> He's saying it's a fix for stable but it's just a cleanup and robustness
> improvement in current kernels - when the patch 76d270364932 (ASoC:
> topology: Check return value for snd_soc_add_dai_link()) was backported
> by the bot the bot missed some other context which triggered bugs.
>
> Copying in Sasha and Greg for stable (not sure if the list works by
> itself).
How this was marked-up is fine, our scripts can easily handle it,
thanks.
greg k-h
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Applied "ASoC: topology: fix soc_tplg_fe_link_create() - link->dobj initialization order" to the asoc tree
2020-01-22 19:07 ` [alsa-devel] " Jaroslav Kysela
@ 2020-01-23 12:36 ` Mark Brown
-1 siblings, 0 replies; 14+ messages in thread
From: Mark Brown @ 2020-01-23 12:36 UTC (permalink / raw)
To: Jaroslav Kysela
Cc: alsa-devel, ALSA development, Dragos Tarcatu, Mark Brown,
Pierre-Louis Bossart, Ranjani Sridharan, stable, stable,
Takashi Iwai
The patch
ASoC: topology: fix soc_tplg_fe_link_create() - link->dobj initialization order
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.5
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 8ce1cbd6ce0b1bda0c980c64fee4c1e1378355f1 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Wed, 22 Jan 2020 20:07:52 +0100
Subject: [PATCH] ASoC: topology: fix soc_tplg_fe_link_create() - link->dobj
initialization order
The code which checks the return value for snd_soc_add_dai_link() call
in soc_tplg_fe_link_create() moved the snd_soc_add_dai_link() call before
link->dobj members initialization.
While it does not affect the latest kernels, the old soc-core.c code
in the stable kernels is affected. The snd_soc_add_dai_link() function uses
the link->dobj.type member to check, if the link structure is valid.
Reorder the link->dobj initialization to make things work again.
It's harmless for the recent code (and the structure should be properly
initialized before other calls anyway).
The problem is in stable linux-5.4.y since version 5.4.11 when the
upstream commit 76d270364932 was applied.
Fixes: 76d270364932 ("ASoC: topology: Check return value for snd_soc_add_dai_link()")
Cc: Dragos Tarcatu <dragos_tarcatu@mentor.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20200122190752.3081016-1-perex@perex.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
---
sound/soc/soc-topology.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index 92e4f4d08bfa..4e1fe623c390 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -1906,6 +1906,10 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg,
link->num_codecs = 1;
link->num_platforms = 1;
+ link->dobj.index = tplg->index;
+ link->dobj.ops = tplg->ops;
+ link->dobj.type = SND_SOC_DOBJ_DAI_LINK;
+
if (strlen(pcm->pcm_name)) {
link->name = kstrdup(pcm->pcm_name, GFP_KERNEL);
link->stream_name = kstrdup(pcm->pcm_name, GFP_KERNEL);
@@ -1942,9 +1946,6 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg,
goto err;
}
- link->dobj.index = tplg->index;
- link->dobj.ops = tplg->ops;
- link->dobj.type = SND_SOC_DOBJ_DAI_LINK;
list_add(&link->dobj.list, &tplg->comp->dobj_list);
return 0;
--
2.20.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [alsa-devel] Applied "ASoC: topology: fix soc_tplg_fe_link_create() - link->dobj initialization order" to the asoc tree
@ 2020-01-23 12:36 ` Mark Brown
0 siblings, 0 replies; 14+ messages in thread
From: Mark Brown @ 2020-01-23 12:36 UTC (permalink / raw)
To: Jaroslav Kysela
Cc: Dragos Tarcatu, ALSA development, Takashi Iwai,
Pierre-Louis Bossart, stable, Ranjani Sridharan, Mark Brown
The patch
ASoC: topology: fix soc_tplg_fe_link_create() - link->dobj initialization order
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.5
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 8ce1cbd6ce0b1bda0c980c64fee4c1e1378355f1 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Wed, 22 Jan 2020 20:07:52 +0100
Subject: [PATCH] ASoC: topology: fix soc_tplg_fe_link_create() - link->dobj
initialization order
The code which checks the return value for snd_soc_add_dai_link() call
in soc_tplg_fe_link_create() moved the snd_soc_add_dai_link() call before
link->dobj members initialization.
While it does not affect the latest kernels, the old soc-core.c code
in the stable kernels is affected. The snd_soc_add_dai_link() function uses
the link->dobj.type member to check, if the link structure is valid.
Reorder the link->dobj initialization to make things work again.
It's harmless for the recent code (and the structure should be properly
initialized before other calls anyway).
The problem is in stable linux-5.4.y since version 5.4.11 when the
upstream commit 76d270364932 was applied.
Fixes: 76d270364932 ("ASoC: topology: Check return value for snd_soc_add_dai_link()")
Cc: Dragos Tarcatu <dragos_tarcatu@mentor.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20200122190752.3081016-1-perex@perex.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
---
sound/soc/soc-topology.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index 92e4f4d08bfa..4e1fe623c390 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -1906,6 +1906,10 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg,
link->num_codecs = 1;
link->num_platforms = 1;
+ link->dobj.index = tplg->index;
+ link->dobj.ops = tplg->ops;
+ link->dobj.type = SND_SOC_DOBJ_DAI_LINK;
+
if (strlen(pcm->pcm_name)) {
link->name = kstrdup(pcm->pcm_name, GFP_KERNEL);
link->stream_name = kstrdup(pcm->pcm_name, GFP_KERNEL);
@@ -1942,9 +1946,6 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg,
goto err;
}
- link->dobj.index = tplg->index;
- link->dobj.ops = tplg->ops;
- link->dobj.type = SND_SOC_DOBJ_DAI_LINK;
list_add(&link->dobj.list, &tplg->comp->dobj_list);
return 0;
--
2.20.1
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply related [flat|nested] 14+ messages in thread
end of thread, other threads:[~2020-01-23 12:43 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-22 19:07 [PATCH] ASoC: topology: fix soc_tplg_fe_link_create() - link->dobj initialization order Jaroslav Kysela
2020-01-22 19:07 ` [alsa-devel] " Jaroslav Kysela
2020-01-22 19:28 ` Pierre-Louis Bossart
2020-01-22 19:28 ` Pierre-Louis Bossart
2020-01-22 20:25 ` Mark Brown
2020-01-22 20:25 ` Mark Brown
2020-01-22 20:49 ` Jaroslav Kysela
2020-01-22 20:49 ` Jaroslav Kysela
2020-01-22 21:47 ` Pierre-Louis Bossart
2020-01-22 21:47 ` Pierre-Louis Bossart
2020-01-23 6:43 ` Greg Kroah-Hartman
2020-01-23 6:43 ` Greg Kroah-Hartman
2020-01-23 12:36 ` Applied "ASoC: topology: fix soc_tplg_fe_link_create() - link->dobj initialization order" to the asoc tree Mark Brown
2020-01-23 12:36 ` [alsa-devel] " Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.