Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1245730
| From | Lars-Peter Clausen <lars@metafoo.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC PATCH] ASoC: Modify check condition of multiple bindings of components |
| Date | 2015-10-13 15:50 +0200 |
| Message-ID | <qj87N-8dT-27@gated-at.bofh.it> (permalink) |
| References | <qj7Y6-819-29@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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);
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFC PATCH] ASoC: Modify check condition of multiple bindings of components Koro Chen <koro.chen@mediatek.com> - 2015-10-13 15:40 +0200
Re: [RFC PATCH] ASoC: Modify check condition of multiple bindings of components Lars-Peter Clausen <lars@metafoo.de> - 2015-10-13 15:50 +0200
Re: [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components Koro Chen <koro.chen@mediatek.com> - 2015-10-13 16:20 +0200
Re: [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components Lars-Peter Clausen <lars@metafoo.de> - 2015-10-13 16:50 +0200
Re: [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components Koro Chen <koro.chen@mediatek.com> - 2015-10-14 03:20 +0200
Re: [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components Lars-Peter Clausen <lars@metafoo.de> - 2015-10-14 11:20 +0200
Re: [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components Mark Brown <broonie@kernel.org> - 2015-10-15 14:20 +0200
Re: [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components Koro Chen <koro.chen@mediatek.com> - 2015-10-15 14:50 +0200
Re: [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components Lars-Peter Clausen <lars@metafoo.de> - 2015-10-15 15:30 +0200
Re: [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components Koro Chen <koro.chen@mediatek.com> - 2015-10-16 04:40 +0200
csiph-web