All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] ASoC: Modify check condition of multiple bindings of components
@ 2015-10-13 13:37 ` Koro Chen
  0 siblings, 0 replies; 25+ messages in thread
From: Koro Chen @ 2015-10-13 13:37 UTC (permalink / raw)
  To: broonie, perex, tiwai, lgirdwood
  Cc: srv_heupstream, linux-mediatek, s.hauer, linux-arm-kernel,
	linux-kernel, alsa-devel, lars, p.zabel, Koro Chen

The patch "ASoC: Prevent components from being bound to multiple cards"
adds check to prevent multiple cards from using the same component.
However, snd_soc_register_platform() or snd_soc_register_codec() will
also create components, and sharing the same platform by multiple cards
is then refused. This happens with a platform having multiple
independent DAIs that share the same DMA controller.

Relax the condition by checking component->registered_as_component,
which is only true in case of snd_soc_register_component() and
will be false for components created by snd_soc_register_platform()
or snd_soc_register_codec().

Signed-off-by: Koro Chen <koro.chen@mediatek.com>
---
 sound/soc/soc-core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 42575b0..eca169a 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1106,7 +1106,8 @@ static int soc_probe_component(struct snd_soc_card *card,
 		return 0;
 
 	if (component->card) {
-		if (component->card != card) {
+		if (component->card != card &&
+		    component->registered_as_component) {
 			dev_err(component->dev,
 				"Trying to bind component to card \"%s\" but is already bound to card \"%s\"\n",
 				card->name, component->card->name);
-- 
1.7.9.5


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

* [RFC PATCH] ASoC: Modify check condition of multiple bindings of components
@ 2015-10-13 13:37 ` Koro Chen
  0 siblings, 0 replies; 25+ messages in thread
From: Koro Chen @ 2015-10-13 13:37 UTC (permalink / raw)
  To: broonie, perex, tiwai, lgirdwood
  Cc: srv_heupstream, linux-mediatek, s.hauer, linux-arm-kernel,
	linux-kernel, alsa-devel, lars, p.zabel, Koro Chen

The patch "ASoC: Prevent components from being bound to multiple cards"
adds check to prevent multiple cards from using the same component.
However, snd_soc_register_platform() or snd_soc_register_codec() will
also create components, and sharing the same platform by multiple cards
is then refused. This happens with a platform having multiple
independent DAIs that share the same DMA controller.

Relax the condition by checking component->registered_as_component,
which is only true in case of snd_soc_register_component() and
will be false for components created by snd_soc_register_platform()
or snd_soc_register_codec().

Signed-off-by: Koro Chen <koro.chen@mediatek.com>
---
 sound/soc/soc-core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 42575b0..eca169a 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1106,7 +1106,8 @@ static int soc_probe_component(struct snd_soc_card *card,
 		return 0;
 
 	if (component->card) {
-		if (component->card != card) {
+		if (component->card != card &&
+		    component->registered_as_component) {
 			dev_err(component->dev,
 				"Trying to bind component to card \"%s\" but is already bound to card \"%s\"\n",
 				card->name, component->card->name);
-- 
1.7.9.5

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

* [RFC PATCH] ASoC: Modify check condition of multiple bindings of components
@ 2015-10-13 13:37 ` Koro Chen
  0 siblings, 0 replies; 25+ messages in thread
From: Koro Chen @ 2015-10-13 13:37 UTC (permalink / raw)
  To: linux-arm-kernel

The patch "ASoC: Prevent components from being bound to multiple cards"
adds check to prevent multiple cards from using the same component.
However, snd_soc_register_platform() or snd_soc_register_codec() will
also create components, and sharing the same platform by multiple cards
is then refused. This happens with a platform having multiple
independent DAIs that share the same DMA controller.

Relax the condition by checking component->registered_as_component,
which is only true in case of snd_soc_register_component() and
will be false for components created by snd_soc_register_platform()
or snd_soc_register_codec().

Signed-off-by: Koro Chen <koro.chen@mediatek.com>
---
 sound/soc/soc-core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 42575b0..eca169a 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1106,7 +1106,8 @@ static int soc_probe_component(struct snd_soc_card *card,
 		return 0;
 
 	if (component->card) {
-		if (component->card != card) {
+		if (component->card != card &&
+		    component->registered_as_component) {
 			dev_err(component->dev,
 				"Trying to bind component to card \"%s\" but is already bound to card \"%s\"\n",
 				card->name, component->card->name);
-- 
1.7.9.5

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

* Re: [RFC PATCH] ASoC: Modify check condition of multiple bindings of components
  2015-10-13 13:37 ` Koro Chen
@ 2015-10-13 13:44   ` Lars-Peter Clausen
  -1 siblings, 0 replies; 25+ messages in thread
From: Lars-Peter Clausen @ 2015-10-13 13:44 UTC (permalink / raw)
  To: Koro Chen, broonie, perex, tiwai, lgirdwood
  Cc: srv_heupstream, linux-mediatek, s.hauer, linux-arm-kernel,
	linux-kernel, alsa-devel, p.zabel

On 10/13/2015 03:37 PM, Koro Chen wrote:
> The patch "ASoC: Prevent components from being bound to multiple cards"
> adds check to prevent multiple cards from using the same component.
> However, snd_soc_register_platform() or snd_soc_register_codec() will
> also create components, and sharing the same platform by multiple cards
> is then refused. This happens with a platform having multiple
> independent DAIs that share the same DMA controller.
> 
> Relax the condition by checking component->registered_as_component,
> which is only true in case of snd_soc_register_component() and
> will be false for components created by snd_soc_register_platform()
> or snd_soc_register_codec().

Binding a component to multiple cards results in internal data structure
corruption, regardless of whether it is a raw component, CODEC or platform,
which is why the check was added. So the proposed change wont work.

> 
> Signed-off-by: Koro Chen <koro.chen@mediatek.com>
> ---
>  sound/soc/soc-core.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> index 42575b0..eca169a 100644
> --- a/sound/soc/soc-core.c
> +++ b/sound/soc/soc-core.c
> @@ -1106,7 +1106,8 @@ static int soc_probe_component(struct snd_soc_card *card,
>  		return 0;
>  
>  	if (component->card) {
> -		if (component->card != card) {
> +		if (component->card != card &&
> +		    component->registered_as_component) {
>  			dev_err(component->dev,
>  				"Trying to bind component to card \"%s\" but is already bound to card \"%s\"\n",
>  				card->name, component->card->name);
> 


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

* [RFC PATCH] ASoC: Modify check condition of multiple bindings of components
@ 2015-10-13 13:44   ` Lars-Peter Clausen
  0 siblings, 0 replies; 25+ messages in thread
From: Lars-Peter Clausen @ 2015-10-13 13:44 UTC (permalink / raw)
  To: linux-arm-kernel

On 10/13/2015 03:37 PM, Koro Chen wrote:
> The patch "ASoC: Prevent components from being bound to multiple cards"
> adds check to prevent multiple cards from using the same component.
> However, snd_soc_register_platform() or snd_soc_register_codec() will
> also create components, and sharing the same platform by multiple cards
> is then refused. This happens with a platform having multiple
> independent DAIs that share the same DMA controller.
> 
> Relax the condition by checking component->registered_as_component,
> which is only true in case of snd_soc_register_component() and
> will be false for components created by snd_soc_register_platform()
> or snd_soc_register_codec().

Binding a component to multiple cards results in internal data structure
corruption, regardless of whether it is a raw component, CODEC or platform,
which is why the check was added. So the proposed change wont work.

> 
> Signed-off-by: Koro Chen <koro.chen@mediatek.com>
> ---
>  sound/soc/soc-core.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> index 42575b0..eca169a 100644
> --- a/sound/soc/soc-core.c
> +++ b/sound/soc/soc-core.c
> @@ -1106,7 +1106,8 @@ static int soc_probe_component(struct snd_soc_card *card,
>  		return 0;
>  
>  	if (component->card) {
> -		if (component->card != card) {
> +		if (component->card != card &&
> +		    component->registered_as_component) {
>  			dev_err(component->dev,
>  				"Trying to bind component to card \"%s\" but is already bound to card \"%s\"\n",
>  				card->name, component->card->name);
> 

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

* Re: [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components
  2015-10-13 13:44   ` Lars-Peter Clausen
  (?)
@ 2015-10-13 14:18     ` Koro Chen
  -1 siblings, 0 replies; 25+ messages in thread
From: Koro Chen @ 2015-10-13 14:18 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: broonie, perex, tiwai, lgirdwood, alsa-devel, srv_heupstream,
	s.hauer, linux-kernel, linux-mediatek, p.zabel, linux-arm-kernel

On Tue, 2015-10-13 at 15:44 +0200, Lars-Peter Clausen wrote:
> On 10/13/2015 03:37 PM, Koro Chen wrote:
> > The patch "ASoC: Prevent components from being bound to multiple cards"
> > adds check to prevent multiple cards from using the same component.
> > However, snd_soc_register_platform() or snd_soc_register_codec() will
> > also create components, and sharing the same platform by multiple cards
> > is then refused. This happens with a platform having multiple
> > independent DAIs that share the same DMA controller.
> > 
> > Relax the condition by checking component->registered_as_component,
> > which is only true in case of snd_soc_register_component() and
> > will be false for components created by snd_soc_register_platform()
> > or snd_soc_register_codec().
> 
> Binding a component to multiple cards results in internal data structure
> corruption, regardless of whether it is a raw component, CODEC or platform,
> which is why the check was added. So the proposed change wont work.
> 
Thanks for your comment. Is it possible to share an example of how the
data structure will be corrupted? So I can study into this further.
 
> > 
> > Signed-off-by: Koro Chen <koro.chen@mediatek.com>
> > ---
> >  sound/soc/soc-core.c |    3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> > index 42575b0..eca169a 100644
> > --- a/sound/soc/soc-core.c
> > +++ b/sound/soc/soc-core.c
> > @@ -1106,7 +1106,8 @@ static int soc_probe_component(struct snd_soc_card *card,
> >  		return 0;
> >  
> >  	if (component->card) {
> > -		if (component->card != card) {
> > +		if (component->card != card &&
> > +		    component->registered_as_component) {
> >  			dev_err(component->dev,
> >  				"Trying to bind component to card \"%s\" but is already bound to card \"%s\"\n",
> >  				card->name, component->card->name);
> > 
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



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

* Re: [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components
@ 2015-10-13 14:18     ` Koro Chen
  0 siblings, 0 replies; 25+ messages in thread
From: Koro Chen @ 2015-10-13 14:18 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: broonie, perex, tiwai, lgirdwood, alsa-devel, srv_heupstream,
	s.hauer, linux-kernel, linux-mediatek, p.zabel, linux-arm-kernel

On Tue, 2015-10-13 at 15:44 +0200, Lars-Peter Clausen wrote:
> On 10/13/2015 03:37 PM, Koro Chen wrote:
> > The patch "ASoC: Prevent components from being bound to multiple cards"
> > adds check to prevent multiple cards from using the same component.
> > However, snd_soc_register_platform() or snd_soc_register_codec() will
> > also create components, and sharing the same platform by multiple cards
> > is then refused. This happens with a platform having multiple
> > independent DAIs that share the same DMA controller.
> > 
> > Relax the condition by checking component->registered_as_component,
> > which is only true in case of snd_soc_register_component() and
> > will be false for components created by snd_soc_register_platform()
> > or snd_soc_register_codec().
> 
> Binding a component to multiple cards results in internal data structure
> corruption, regardless of whether it is a raw component, CODEC or platform,
> which is why the check was added. So the proposed change wont work.
> 
Thanks for your comment. Is it possible to share an example of how the
data structure will be corrupted? So I can study into this further.
 
> > 
> > Signed-off-by: Koro Chen <koro.chen@mediatek.com>
> > ---
> >  sound/soc/soc-core.c |    3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> > index 42575b0..eca169a 100644
> > --- a/sound/soc/soc-core.c
> > +++ b/sound/soc/soc-core.c
> > @@ -1106,7 +1106,8 @@ static int soc_probe_component(struct snd_soc_card *card,
> >  		return 0;
> >  
> >  	if (component->card) {
> > -		if (component->card != card) {
> > +		if (component->card != card &&
> > +		    component->registered_as_component) {
> >  			dev_err(component->dev,
> >  				"Trying to bind component to card \"%s\" but is already bound to card \"%s\"\n",
> >  				card->name, component->card->name);
> > 
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components
@ 2015-10-13 14:18     ` Koro Chen
  0 siblings, 0 replies; 25+ messages in thread
From: Koro Chen @ 2015-10-13 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 2015-10-13 at 15:44 +0200, Lars-Peter Clausen wrote:
> On 10/13/2015 03:37 PM, Koro Chen wrote:
> > The patch "ASoC: Prevent components from being bound to multiple cards"
> > adds check to prevent multiple cards from using the same component.
> > However, snd_soc_register_platform() or snd_soc_register_codec() will
> > also create components, and sharing the same platform by multiple cards
> > is then refused. This happens with a platform having multiple
> > independent DAIs that share the same DMA controller.
> > 
> > Relax the condition by checking component->registered_as_component,
> > which is only true in case of snd_soc_register_component() and
> > will be false for components created by snd_soc_register_platform()
> > or snd_soc_register_codec().
> 
> Binding a component to multiple cards results in internal data structure
> corruption, regardless of whether it is a raw component, CODEC or platform,
> which is why the check was added. So the proposed change wont work.
> 
Thanks for your comment. Is it possible to share an example of how the
data structure will be corrupted? So I can study into this further.
 
> > 
> > Signed-off-by: Koro Chen <koro.chen@mediatek.com>
> > ---
> >  sound/soc/soc-core.c |    3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> > index 42575b0..eca169a 100644
> > --- a/sound/soc/soc-core.c
> > +++ b/sound/soc/soc-core.c
> > @@ -1106,7 +1106,8 @@ static int soc_probe_component(struct snd_soc_card *card,
> >  		return 0;
> >  
> >  	if (component->card) {
> > -		if (component->card != card) {
> > +		if (component->card != card &&
> > +		    component->registered_as_component) {
> >  			dev_err(component->dev,
> >  				"Trying to bind component to card \"%s\" but is already bound to card \"%s\"\n",
> >  				card->name, component->card->name);
> > 
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel at alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components
  2015-10-13 14:18     ` Koro Chen
@ 2015-10-13 14:42       ` Lars-Peter Clausen
  -1 siblings, 0 replies; 25+ messages in thread
From: Lars-Peter Clausen @ 2015-10-13 14:42 UTC (permalink / raw)
  To: Koro Chen
  Cc: broonie, perex, tiwai, lgirdwood, alsa-devel, srv_heupstream,
	s.hauer, linux-kernel, linux-mediatek, p.zabel, linux-arm-kernel

On 10/13/2015 04:18 PM, Koro Chen wrote:
> On Tue, 2015-10-13 at 15:44 +0200, Lars-Peter Clausen wrote:
>> On 10/13/2015 03:37 PM, Koro Chen wrote:
>>> The patch "ASoC: Prevent components from being bound to multiple cards"
>>> adds check to prevent multiple cards from using the same component.
>>> However, snd_soc_register_platform() or snd_soc_register_codec() will
>>> also create components, and sharing the same platform by multiple cards
>>> is then refused. This happens with a platform having multiple
>>> independent DAIs that share the same DMA controller.
>>>
>>> Relax the condition by checking component->registered_as_component,
>>> which is only true in case of snd_soc_register_component() and
>>> will be false for components created by snd_soc_register_platform()
>>> or snd_soc_register_codec().
>>
>> Binding a component to multiple cards results in internal data structure
>> corruption, regardless of whether it is a raw component, CODEC or platform,
>> which is why the check was added. So the proposed change wont work.
>>
> Thanks for your comment. Is it possible to share an example of how the
> data structure will be corrupted? So I can study into this further.

Just look at soc_probe_component() and think about what happens if that runs
twice for two different cards. Multiple calls to list_add() on the same
list, controls are added multiple times, DAPM widgets are created multiple
times, the card field will only point to the last card.


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

* [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components
@ 2015-10-13 14:42       ` Lars-Peter Clausen
  0 siblings, 0 replies; 25+ messages in thread
From: Lars-Peter Clausen @ 2015-10-13 14:42 UTC (permalink / raw)
  To: linux-arm-kernel

On 10/13/2015 04:18 PM, Koro Chen wrote:
> On Tue, 2015-10-13 at 15:44 +0200, Lars-Peter Clausen wrote:
>> On 10/13/2015 03:37 PM, Koro Chen wrote:
>>> The patch "ASoC: Prevent components from being bound to multiple cards"
>>> adds check to prevent multiple cards from using the same component.
>>> However, snd_soc_register_platform() or snd_soc_register_codec() will
>>> also create components, and sharing the same platform by multiple cards
>>> is then refused. This happens with a platform having multiple
>>> independent DAIs that share the same DMA controller.
>>>
>>> Relax the condition by checking component->registered_as_component,
>>> which is only true in case of snd_soc_register_component() and
>>> will be false for components created by snd_soc_register_platform()
>>> or snd_soc_register_codec().
>>
>> Binding a component to multiple cards results in internal data structure
>> corruption, regardless of whether it is a raw component, CODEC or platform,
>> which is why the check was added. So the proposed change wont work.
>>
> Thanks for your comment. Is it possible to share an example of how the
> data structure will be corrupted? So I can study into this further.

Just look at soc_probe_component() and think about what happens if that runs
twice for two different cards. Multiple calls to list_add() on the same
list, controls are added multiple times, DAPM widgets are created multiple
times, the card field will only point to the last card.

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

* Re: [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components
  2015-10-13 14:42       ` Lars-Peter Clausen
  (?)
@ 2015-10-14  1:19         ` Koro Chen
  -1 siblings, 0 replies; 25+ messages in thread
From: Koro Chen @ 2015-10-14  1:19 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: alsa-devel, srv_heupstream, tiwai, linux-kernel, s.hauer,
	lgirdwood, perex, broonie, linux-mediatek, p.zabel,
	linux-arm-kernel

On Tue, 2015-10-13 at 16:42 +0200, Lars-Peter Clausen wrote:
> On 10/13/2015 04:18 PM, Koro Chen wrote:
> > On Tue, 2015-10-13 at 15:44 +0200, Lars-Peter Clausen wrote:
> >> On 10/13/2015 03:37 PM, Koro Chen wrote:
> >>> The patch "ASoC: Prevent components from being bound to multiple cards"
> >>> adds check to prevent multiple cards from using the same component.
> >>> However, snd_soc_register_platform() or snd_soc_register_codec() will
> >>> also create components, and sharing the same platform by multiple cards
> >>> is then refused. This happens with a platform having multiple
> >>> independent DAIs that share the same DMA controller.
> >>>
> >>> Relax the condition by checking component->registered_as_component,
> >>> which is only true in case of snd_soc_register_component() and
> >>> will be false for components created by snd_soc_register_platform()
> >>> or snd_soc_register_codec().
> >>
> >> Binding a component to multiple cards results in internal data structure
> >> corruption, regardless of whether it is a raw component, CODEC or platform,
> >> which is why the check was added. So the proposed change wont work.
> >>
> > Thanks for your comment. Is it possible to share an example of how the
> > data structure will be corrupted? So I can study into this further.
> 
> Just look at soc_probe_component() and think about what happens if that runs
> twice for two different cards. Multiple calls to list_add() on the same
> list, controls are added multiple times, DAPM widgets are created multiple
> times, the card field will only point to the last card.
> 
When multiple binding happens, soc_probe_component() just returns zero
without doing anything after this patch (actually it also returned zero
before the patch "ASoC: Prevent components from being bound to multiple
cards"). So the component still binds to the first card. For this case I
think it should be fine?

> 
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek



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

* Re: [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components
@ 2015-10-14  1:19         ` Koro Chen
  0 siblings, 0 replies; 25+ messages in thread
From: Koro Chen @ 2015-10-14  1:19 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: alsa-devel, srv_heupstream, tiwai, linux-kernel, s.hauer,
	lgirdwood, perex, broonie, linux-mediatek, p.zabel,
	linux-arm-kernel

On Tue, 2015-10-13 at 16:42 +0200, Lars-Peter Clausen wrote:
> On 10/13/2015 04:18 PM, Koro Chen wrote:
> > On Tue, 2015-10-13 at 15:44 +0200, Lars-Peter Clausen wrote:
> >> On 10/13/2015 03:37 PM, Koro Chen wrote:
> >>> The patch "ASoC: Prevent components from being bound to multiple cards"
> >>> adds check to prevent multiple cards from using the same component.
> >>> However, snd_soc_register_platform() or snd_soc_register_codec() will
> >>> also create components, and sharing the same platform by multiple cards
> >>> is then refused. This happens with a platform having multiple
> >>> independent DAIs that share the same DMA controller.
> >>>
> >>> Relax the condition by checking component->registered_as_component,
> >>> which is only true in case of snd_soc_register_component() and
> >>> will be false for components created by snd_soc_register_platform()
> >>> or snd_soc_register_codec().
> >>
> >> Binding a component to multiple cards results in internal data structure
> >> corruption, regardless of whether it is a raw component, CODEC or platform,
> >> which is why the check was added. So the proposed change wont work.
> >>
> > Thanks for your comment. Is it possible to share an example of how the
> > data structure will be corrupted? So I can study into this further.
> 
> Just look at soc_probe_component() and think about what happens if that runs
> twice for two different cards. Multiple calls to list_add() on the same
> list, controls are added multiple times, DAPM widgets are created multiple
> times, the card field will only point to the last card.
> 
When multiple binding happens, soc_probe_component() just returns zero
without doing anything after this patch (actually it also returned zero
before the patch "ASoC: Prevent components from being bound to multiple
cards"). So the component still binds to the first card. For this case I
think it should be fine?

> 
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components
@ 2015-10-14  1:19         ` Koro Chen
  0 siblings, 0 replies; 25+ messages in thread
From: Koro Chen @ 2015-10-14  1:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 2015-10-13 at 16:42 +0200, Lars-Peter Clausen wrote:
> On 10/13/2015 04:18 PM, Koro Chen wrote:
> > On Tue, 2015-10-13 at 15:44 +0200, Lars-Peter Clausen wrote:
> >> On 10/13/2015 03:37 PM, Koro Chen wrote:
> >>> The patch "ASoC: Prevent components from being bound to multiple cards"
> >>> adds check to prevent multiple cards from using the same component.
> >>> However, snd_soc_register_platform() or snd_soc_register_codec() will
> >>> also create components, and sharing the same platform by multiple cards
> >>> is then refused. This happens with a platform having multiple
> >>> independent DAIs that share the same DMA controller.
> >>>
> >>> Relax the condition by checking component->registered_as_component,
> >>> which is only true in case of snd_soc_register_component() and
> >>> will be false for components created by snd_soc_register_platform()
> >>> or snd_soc_register_codec().
> >>
> >> Binding a component to multiple cards results in internal data structure
> >> corruption, regardless of whether it is a raw component, CODEC or platform,
> >> which is why the check was added. So the proposed change wont work.
> >>
> > Thanks for your comment. Is it possible to share an example of how the
> > data structure will be corrupted? So I can study into this further.
> 
> Just look at soc_probe_component() and think about what happens if that runs
> twice for two different cards. Multiple calls to list_add() on the same
> list, controls are added multiple times, DAPM widgets are created multiple
> times, the card field will only point to the last card.
> 
When multiple binding happens, soc_probe_component() just returns zero
without doing anything after this patch (actually it also returned zero
before the patch "ASoC: Prevent components from being bound to multiple
cards"). So the component still binds to the first card. For this case I
think it should be fine?

> 
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components
  2015-10-14  1:19         ` Koro Chen
@ 2015-10-14  9:00           ` Lars-Peter Clausen
  -1 siblings, 0 replies; 25+ messages in thread
From: Lars-Peter Clausen @ 2015-10-14  9:00 UTC (permalink / raw)
  To: Koro Chen
  Cc: alsa-devel, srv_heupstream, tiwai, s.hauer, linux-kernel,
	lgirdwood, broonie, linux-mediatek, p.zabel, linux-arm-kernel

On 10/14/2015 03:19 AM, Koro Chen wrote:
> On Tue, 2015-10-13 at 16:42 +0200, Lars-Peter Clausen wrote:
>> On 10/13/2015 04:18 PM, Koro Chen wrote:
>>> On Tue, 2015-10-13 at 15:44 +0200, Lars-Peter Clausen wrote:
>>>> On 10/13/2015 03:37 PM, Koro Chen wrote:
>>>>> The patch "ASoC: Prevent components from being bound to multiple cards"
>>>>> adds check to prevent multiple cards from using the same component.
>>>>> However, snd_soc_register_platform() or snd_soc_register_codec() will
>>>>> also create components, and sharing the same platform by multiple cards
>>>>> is then refused. This happens with a platform having multiple
>>>>> independent DAIs that share the same DMA controller.
>>>>>
>>>>> Relax the condition by checking component->registered_as_component,
>>>>> which is only true in case of snd_soc_register_component() and
>>>>> will be false for components created by snd_soc_register_platform()
>>>>> or snd_soc_register_codec().
>>>>
>>>> Binding a component to multiple cards results in internal data structure
>>>> corruption, regardless of whether it is a raw component, CODEC or platform,
>>>> which is why the check was added. So the proposed change wont work.
>>>>
>>> Thanks for your comment. Is it possible to share an example of how the
>>> data structure will be corrupted? So I can study into this further.
>>
>> Just look at soc_probe_component() and think about what happens if that runs
>> twice for two different cards. Multiple calls to list_add() on the same
>> list, controls are added multiple times, DAPM widgets are created multiple
>> times, the card field will only point to the last card.
>>
> When multiple binding happens, soc_probe_component() just returns zero
> without doing anything after this patch (actually it also returned zero
> before the patch "ASoC: Prevent components from being bound to multiple
> cards"). So the component still binds to the first card. For this case I
> think it should be fine?

Same answer as before more or less. There is a lot of card specific
initialization happening in soc_probe_component(). The card field is
initialized to the card the component is bound to, the DAPM widgets are
created for the component in the cards DAPM graph, DAI link widgets are
created and so on. If you bind the component to multiple cards the
initialization will only be done for one card, the first one it was bound
to, that doesn't make too much sense. If you look at the snd_soc_component
data structure it should be obvious that it does not make sense to associate
it with more than a single card.

It was never intended that it is possible to bind a component to multiple
cards. That it was possible was a bug that was overlooked and some people
tried to do it which caused apparently random crashes later on, caused by
the data structure corruption. This is why we added the check to catch this
kind of mistake early and to avoid the crashes.

- Lars


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

* [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components
@ 2015-10-14  9:00           ` Lars-Peter Clausen
  0 siblings, 0 replies; 25+ messages in thread
From: Lars-Peter Clausen @ 2015-10-14  9:00 UTC (permalink / raw)
  To: linux-arm-kernel

On 10/14/2015 03:19 AM, Koro Chen wrote:
> On Tue, 2015-10-13 at 16:42 +0200, Lars-Peter Clausen wrote:
>> On 10/13/2015 04:18 PM, Koro Chen wrote:
>>> On Tue, 2015-10-13 at 15:44 +0200, Lars-Peter Clausen wrote:
>>>> On 10/13/2015 03:37 PM, Koro Chen wrote:
>>>>> The patch "ASoC: Prevent components from being bound to multiple cards"
>>>>> adds check to prevent multiple cards from using the same component.
>>>>> However, snd_soc_register_platform() or snd_soc_register_codec() will
>>>>> also create components, and sharing the same platform by multiple cards
>>>>> is then refused. This happens with a platform having multiple
>>>>> independent DAIs that share the same DMA controller.
>>>>>
>>>>> Relax the condition by checking component->registered_as_component,
>>>>> which is only true in case of snd_soc_register_component() and
>>>>> will be false for components created by snd_soc_register_platform()
>>>>> or snd_soc_register_codec().
>>>>
>>>> Binding a component to multiple cards results in internal data structure
>>>> corruption, regardless of whether it is a raw component, CODEC or platform,
>>>> which is why the check was added. So the proposed change wont work.
>>>>
>>> Thanks for your comment. Is it possible to share an example of how the
>>> data structure will be corrupted? So I can study into this further.
>>
>> Just look at soc_probe_component() and think about what happens if that runs
>> twice for two different cards. Multiple calls to list_add() on the same
>> list, controls are added multiple times, DAPM widgets are created multiple
>> times, the card field will only point to the last card.
>>
> When multiple binding happens, soc_probe_component() just returns zero
> without doing anything after this patch (actually it also returned zero
> before the patch "ASoC: Prevent components from being bound to multiple
> cards"). So the component still binds to the first card. For this case I
> think it should be fine?

Same answer as before more or less. There is a lot of card specific
initialization happening in soc_probe_component(). The card field is
initialized to the card the component is bound to, the DAPM widgets are
created for the component in the cards DAPM graph, DAI link widgets are
created and so on. If you bind the component to multiple cards the
initialization will only be done for one card, the first one it was bound
to, that doesn't make too much sense. If you look at the snd_soc_component
data structure it should be obvious that it does not make sense to associate
it with more than a single card.

It was never intended that it is possible to bind a component to multiple
cards. That it was possible was a bug that was overlooked and some people
tried to do it which caused apparently random crashes later on, caused by
the data structure corruption. This is why we added the check to catch this
kind of mistake early and to avoid the crashes.

- Lars

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

* Re: [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components
  2015-10-14  9:00           ` Lars-Peter Clausen
@ 2015-10-15 12:10             ` Mark Brown
  -1 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2015-10-15 12:10 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Koro Chen, alsa-devel, srv_heupstream, tiwai, s.hauer,
	linux-kernel, lgirdwood, linux-mediatek, p.zabel,
	linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 728 bytes --]

On Wed, Oct 14, 2015 at 11:00:01AM +0200, Lars-Peter Clausen wrote:

> It was never intended that it is possible to bind a component to multiple
> cards. That it was possible was a bug that was overlooked and some people
> tried to do it which caused apparently random crashes later on, caused by
> the data structure corruption. This is why we added the check to catch this
> kind of mistake early and to avoid the crashes.

This is true, but I do think it's something that we should have some
story on supporting for some of this hardware that has a bunch of
channels in one IP block that can't really interact with each other.
It's going to make it a lot easier for people to think about the
hardware and how to describe it.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components
@ 2015-10-15 12:10             ` Mark Brown
  0 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2015-10-15 12:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Oct 14, 2015 at 11:00:01AM +0200, Lars-Peter Clausen wrote:

> It was never intended that it is possible to bind a component to multiple
> cards. That it was possible was a bug that was overlooked and some people
> tried to do it which caused apparently random crashes later on, caused by
> the data structure corruption. This is why we added the check to catch this
> kind of mistake early and to avoid the crashes.

This is true, but I do think it's something that we should have some
story on supporting for some of this hardware that has a bunch of
channels in one IP block that can't really interact with each other.
It's going to make it a lot easier for people to think about the
hardware and how to describe it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151015/3814f238/attachment.sig>

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

* Re: [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components
  2015-10-15 12:10             ` Mark Brown
  (?)
@ 2015-10-15 12:49               ` Koro Chen
  -1 siblings, 0 replies; 25+ messages in thread
From: Koro Chen @ 2015-10-15 12:49 UTC (permalink / raw)
  To: Mark Brown
  Cc: Lars-Peter Clausen, alsa-devel, srv_heupstream, tiwai, s.hauer,
	linux-kernel, lgirdwood, linux-mediatek, p.zabel,
	linux-arm-kernel

On Thu, 2015-10-15 at 13:10 +0100, Mark Brown wrote:
> On Wed, Oct 14, 2015 at 11:00:01AM +0200, Lars-Peter Clausen wrote:
> 
> > It was never intended that it is possible to bind a component to multiple
> > cards. That it was possible was a bug that was overlooked and some people
> > tried to do it which caused apparently random crashes later on, caused by
> > the data structure corruption. This is why we added the check to catch this
> > kind of mistake early and to avoid the crashes.
> 
> This is true, but I do think it's something that we should have some
> story on supporting for some of this hardware that has a bunch of
> channels in one IP block that can't really interact with each other.
> It's going to make it a lot easier for people to think about the
> hardware and how to describe it.
Yes, and if in some cases we must use multiple cards, it seems the only
option left is to separate an ASoC platform driver into multiple
drivers. It does not make sense to me since there is only one HW block.



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

* Re: [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components
@ 2015-10-15 12:49               ` Koro Chen
  0 siblings, 0 replies; 25+ messages in thread
From: Koro Chen @ 2015-10-15 12:49 UTC (permalink / raw)
  To: Mark Brown
  Cc: Lars-Peter Clausen, alsa-devel, srv_heupstream, tiwai, s.hauer,
	linux-kernel, lgirdwood, linux-mediatek, p.zabel,
	linux-arm-kernel

On Thu, 2015-10-15 at 13:10 +0100, Mark Brown wrote:
> On Wed, Oct 14, 2015 at 11:00:01AM +0200, Lars-Peter Clausen wrote:
> 
> > It was never intended that it is possible to bind a component to multiple
> > cards. That it was possible was a bug that was overlooked and some people
> > tried to do it which caused apparently random crashes later on, caused by
> > the data structure corruption. This is why we added the check to catch this
> > kind of mistake early and to avoid the crashes.
> 
> This is true, but I do think it's something that we should have some
> story on supporting for some of this hardware that has a bunch of
> channels in one IP block that can't really interact with each other.
> It's going to make it a lot easier for people to think about the
> hardware and how to describe it.
Yes, and if in some cases we must use multiple cards, it seems the only
option left is to separate an ASoC platform driver into multiple
drivers. It does not make sense to me since there is only one HW block.

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

* [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components
@ 2015-10-15 12:49               ` Koro Chen
  0 siblings, 0 replies; 25+ messages in thread
From: Koro Chen @ 2015-10-15 12:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 2015-10-15 at 13:10 +0100, Mark Brown wrote:
> On Wed, Oct 14, 2015 at 11:00:01AM +0200, Lars-Peter Clausen wrote:
> 
> > It was never intended that it is possible to bind a component to multiple
> > cards. That it was possible was a bug that was overlooked and some people
> > tried to do it which caused apparently random crashes later on, caused by
> > the data structure corruption. This is why we added the check to catch this
> > kind of mistake early and to avoid the crashes.
> 
> This is true, but I do think it's something that we should have some
> story on supporting for some of this hardware that has a bunch of
> channels in one IP block that can't really interact with each other.
> It's going to make it a lot easier for people to think about the
> hardware and how to describe it.
Yes, and if in some cases we must use multiple cards, it seems the only
option left is to separate an ASoC platform driver into multiple
drivers. It does not make sense to me since there is only one HW block.

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

* Re: [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components
  2015-10-15 12:10             ` Mark Brown
@ 2015-10-15 13:26               ` Lars-Peter Clausen
  -1 siblings, 0 replies; 25+ messages in thread
From: Lars-Peter Clausen @ 2015-10-15 13:26 UTC (permalink / raw)
  To: Mark Brown
  Cc: Koro Chen, alsa-devel, srv_heupstream, tiwai, s.hauer,
	linux-kernel, lgirdwood, linux-mediatek, p.zabel,
	linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 1406 bytes --]

On 10/15/2015 02:10 PM, Mark Brown wrote:
> On Wed, Oct 14, 2015 at 11:00:01AM +0200, Lars-Peter Clausen wrote:
> 
>> It was never intended that it is possible to bind a component to multiple
>> cards. That it was possible was a bug that was overlooked and some people
>> tried to do it which caused apparently random crashes later on, caused by
>> the data structure corruption. This is why we added the check to catch this
>> kind of mistake early and to avoid the crashes.
> 
> This is true, but I do think it's something that we should have some
> story on supporting for some of this hardware that has a bunch of
> channels in one IP block that can't really interact with each other.
> It's going to make it a lot easier for people to think about the
> hardware and how to describe it.

I'm not saying we shouldn't support it, just that we can't support it with
the current code. And adding support for it will require a fair bit of
restructuring.

If a hardware block as multiple independent channels the best approach in my
opinion is to register multiple components (Which we can't do at the moment,
because there can only be one component per device). From a framework point
of view there is no difference between a single device with multiple
independent channels and multiple independent devices with one channel each.
Both have the same logical topology.

- Lars



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components
@ 2015-10-15 13:26               ` Lars-Peter Clausen
  0 siblings, 0 replies; 25+ messages in thread
From: Lars-Peter Clausen @ 2015-10-15 13:26 UTC (permalink / raw)
  To: linux-arm-kernel

On 10/15/2015 02:10 PM, Mark Brown wrote:
> On Wed, Oct 14, 2015 at 11:00:01AM +0200, Lars-Peter Clausen wrote:
> 
>> It was never intended that it is possible to bind a component to multiple
>> cards. That it was possible was a bug that was overlooked and some people
>> tried to do it which caused apparently random crashes later on, caused by
>> the data structure corruption. This is why we added the check to catch this
>> kind of mistake early and to avoid the crashes.
> 
> This is true, but I do think it's something that we should have some
> story on supporting for some of this hardware that has a bunch of
> channels in one IP block that can't really interact with each other.
> It's going to make it a lot easier for people to think about the
> hardware and how to describe it.

I'm not saying we shouldn't support it, just that we can't support it with
the current code. And adding support for it will require a fair bit of
restructuring.

If a hardware block as multiple independent channels the best approach in my
opinion is to register multiple components (Which we can't do at the moment,
because there can only be one component per device). From a framework point
of view there is no difference between a single device with multiple
independent channels and multiple independent devices with one channel each.
Both have the same logical topology.

- Lars


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151015/467e83ef/attachment.sig>

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

* Re: [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components
  2015-10-15 13:26               ` Lars-Peter Clausen
  (?)
@ 2015-10-16  2:31                 ` Koro Chen
  -1 siblings, 0 replies; 25+ messages in thread
From: Koro Chen @ 2015-10-16  2:31 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Mark Brown, alsa-devel, srv_heupstream, tiwai, s.hauer,
	linux-kernel, lgirdwood, linux-mediatek, p.zabel,
	linux-arm-kernel

On Thu, 2015-10-15 at 15:26 +0200, Lars-Peter Clausen wrote:
> On 10/15/2015 02:10 PM, Mark Brown wrote:
> > On Wed, Oct 14, 2015 at 11:00:01AM +0200, Lars-Peter Clausen wrote:
> > 
> >> It was never intended that it is possible to bind a component to multiple
> >> cards. That it was possible was a bug that was overlooked and some people
> >> tried to do it which caused apparently random crashes later on, caused by
> >> the data structure corruption. This is why we added the check to catch this
> >> kind of mistake early and to avoid the crashes.
> > 
> > This is true, but I do think it's something that we should have some
> > story on supporting for some of this hardware that has a bunch of
> > channels in one IP block that can't really interact with each other.
> > It's going to make it a lot easier for people to think about the
> > hardware and how to describe it.
> 
> I'm not saying we shouldn't support it, just that we can't support it with
> the current code. And adding support for it will require a fair bit of
> restructuring.
> 
> If a hardware block as multiple independent channels the best approach in my
> opinion is to register multiple components (Which we can't do at the moment,
> because there can only be one component per device). From a framework point
Yes... I have tried to register 2 platforms in my ASoC platform driver
but alsa considered they are the same platform since they are from the
same device.
> of view there is no difference between a single device with multiple
> independent channels and multiple independent devices with one channel each.
> Both have the same logical topology.
> 
Yes, but in my case there is only one HW, one set of registers, and one
set of clocks, it should be a single device node in the device tree. 
> - Lars
> 
> 



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

* Re: [RFC PATCH] ASoC: Modify check condition of multiple bindings of components
@ 2015-10-16  2:31                 ` Koro Chen
  0 siblings, 0 replies; 25+ messages in thread
From: Koro Chen @ 2015-10-16  2:31 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: alsa-devel, srv_heupstream, tiwai, s.hauer, linux-kernel,
	lgirdwood, Mark Brown, linux-mediatek, p.zabel, linux-arm-kernel

On Thu, 2015-10-15 at 15:26 +0200, Lars-Peter Clausen wrote:
> On 10/15/2015 02:10 PM, Mark Brown wrote:
> > On Wed, Oct 14, 2015 at 11:00:01AM +0200, Lars-Peter Clausen wrote:
> > 
> >> It was never intended that it is possible to bind a component to multiple
> >> cards. That it was possible was a bug that was overlooked and some people
> >> tried to do it which caused apparently random crashes later on, caused by
> >> the data structure corruption. This is why we added the check to catch this
> >> kind of mistake early and to avoid the crashes.
> > 
> > This is true, but I do think it's something that we should have some
> > story on supporting for some of this hardware that has a bunch of
> > channels in one IP block that can't really interact with each other.
> > It's going to make it a lot easier for people to think about the
> > hardware and how to describe it.
> 
> I'm not saying we shouldn't support it, just that we can't support it with
> the current code. And adding support for it will require a fair bit of
> restructuring.
> 
> If a hardware block as multiple independent channels the best approach in my
> opinion is to register multiple components (Which we can't do at the moment,
> because there can only be one component per device). From a framework point
Yes... I have tried to register 2 platforms in my ASoC platform driver
but alsa considered they are the same platform since they are from the
same device.
> of view there is no difference between a single device with multiple
> independent channels and multiple independent devices with one channel each.
> Both have the same logical topology.
> 
Yes, but in my case there is only one HW, one set of registers, and one
set of clocks, it should be a single device node in the device tree. 
> - Lars
> 
> 

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

* [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components
@ 2015-10-16  2:31                 ` Koro Chen
  0 siblings, 0 replies; 25+ messages in thread
From: Koro Chen @ 2015-10-16  2:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 2015-10-15 at 15:26 +0200, Lars-Peter Clausen wrote:
> On 10/15/2015 02:10 PM, Mark Brown wrote:
> > On Wed, Oct 14, 2015 at 11:00:01AM +0200, Lars-Peter Clausen wrote:
> > 
> >> It was never intended that it is possible to bind a component to multiple
> >> cards. That it was possible was a bug that was overlooked and some people
> >> tried to do it which caused apparently random crashes later on, caused by
> >> the data structure corruption. This is why we added the check to catch this
> >> kind of mistake early and to avoid the crashes.
> > 
> > This is true, but I do think it's something that we should have some
> > story on supporting for some of this hardware that has a bunch of
> > channels in one IP block that can't really interact with each other.
> > It's going to make it a lot easier for people to think about the
> > hardware and how to describe it.
> 
> I'm not saying we shouldn't support it, just that we can't support it with
> the current code. And adding support for it will require a fair bit of
> restructuring.
> 
> If a hardware block as multiple independent channels the best approach in my
> opinion is to register multiple components (Which we can't do at the moment,
> because there can only be one component per device). From a framework point
Yes... I have tried to register 2 platforms in my ASoC platform driver
but alsa considered they are the same platform since they are from the
same device.
> of view there is no difference between a single device with multiple
> independent channels and multiple independent devices with one channel each.
> Both have the same logical topology.
> 
Yes, but in my case there is only one HW, one set of registers, and one
set of clocks, it should be a single device node in the device tree. 
> - Lars
> 
> 

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

end of thread, other threads:[~2015-10-16  2:32 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-13 13:37 [RFC PATCH] ASoC: Modify check condition of multiple bindings of components Koro Chen
2015-10-13 13:37 ` Koro Chen
2015-10-13 13:37 ` Koro Chen
2015-10-13 13:44 ` Lars-Peter Clausen
2015-10-13 13:44   ` Lars-Peter Clausen
2015-10-13 14:18   ` [alsa-devel] " Koro Chen
2015-10-13 14:18     ` Koro Chen
2015-10-13 14:18     ` Koro Chen
2015-10-13 14:42     ` Lars-Peter Clausen
2015-10-13 14:42       ` Lars-Peter Clausen
2015-10-14  1:19       ` Koro Chen
2015-10-14  1:19         ` Koro Chen
2015-10-14  1:19         ` Koro Chen
2015-10-14  9:00         ` Lars-Peter Clausen
2015-10-14  9:00           ` Lars-Peter Clausen
2015-10-15 12:10           ` Mark Brown
2015-10-15 12:10             ` Mark Brown
2015-10-15 12:49             ` Koro Chen
2015-10-15 12:49               ` Koro Chen
2015-10-15 12:49               ` Koro Chen
2015-10-15 13:26             ` Lars-Peter Clausen
2015-10-15 13:26               ` Lars-Peter Clausen
2015-10-16  2:31               ` Koro Chen
2015-10-16  2:31                 ` Koro Chen
2015-10-16  2:31                 ` Koro Chen

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.