All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: core: lock client_mutex while removing link components
@ 2019-05-23 17:12 Ranjani Sridharan
  2019-05-23 17:20 ` Pierre-Louis Bossart
  0 siblings, 1 reply; 2+ messages in thread
From: Ranjani Sridharan @ 2019-05-23 17:12 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, broonie, pierre-louis.bossart

Removing link components results in topology unloading. So,
acquire the client_mutex before removing components in
soc_remove_link_components. This will prevent the lockdep warning
seen when dai links are removed during topology removal.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
---
 sound/soc/soc-core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index ce8c057bcd5b..bbb52fbd195e 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1010,12 +1010,14 @@ static void soc_remove_link_components(struct snd_soc_card *card,
 	struct snd_soc_component *component;
 	struct snd_soc_rtdcom_list *rtdcom;
 
+	mutex_lock(&client_mutex);
 	for_each_rtdcom(rtd, rtdcom) {
 		component = rtdcom->component;
 
 		if (component->driver->remove_order == order)
 			soc_remove_component(component);
 	}
+	mutex_unlock(&client_mutex);
 }
 
 static void soc_remove_dai_links(struct snd_soc_card *card)
-- 
2.17.1

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

* Re: [PATCH] ASoC: core: lock client_mutex while removing link components
  2019-05-23 17:12 [PATCH] ASoC: core: lock client_mutex while removing link components Ranjani Sridharan
@ 2019-05-23 17:20 ` Pierre-Louis Bossart
  0 siblings, 0 replies; 2+ messages in thread
From: Pierre-Louis Bossart @ 2019-05-23 17:20 UTC (permalink / raw)
  To: Ranjani Sridharan, alsa-devel; +Cc: tiwai, broonie

On 5/23/19 12:12 PM, Ranjani Sridharan wrote:
> Removing link components results in topology unloading. So,
> acquire the client_mutex before removing components in
> soc_remove_link_components. This will prevent the lockdep warning
> seen when dai links are removed during topology removal.
> 
> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>

GitHub issue: https://github.com/thesofproject/linux/issues/967 for more 
details.

> ---
>   sound/soc/soc-core.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> index ce8c057bcd5b..bbb52fbd195e 100644
> --- a/sound/soc/soc-core.c
> +++ b/sound/soc/soc-core.c
> @@ -1010,12 +1010,14 @@ static void soc_remove_link_components(struct snd_soc_card *card,
>   	struct snd_soc_component *component;
>   	struct snd_soc_rtdcom_list *rtdcom;
>   
> +	mutex_lock(&client_mutex);
>   	for_each_rtdcom(rtd, rtdcom) {
>   		component = rtdcom->component;
>   
>   		if (component->driver->remove_order == order)
>   			soc_remove_component(component);
>   	}
> +	mutex_unlock(&client_mutex);
>   }
>   
>   static void soc_remove_dai_links(struct snd_soc_card *card)
> 

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

end of thread, other threads:[~2019-05-23 17:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-23 17:12 [PATCH] ASoC: core: lock client_mutex while removing link components Ranjani Sridharan
2019-05-23 17:20 ` Pierre-Louis Bossart

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.