Skip to content

Commit

Permalink
ASoC: core: lock client_mutex while removing link components
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Ranjani Sridharan authored and Mark Brown committed May 24, 2019
1 parent 4819d06 commit 34ac3c3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1005,12 +1005,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)
Expand Down

0 comments on commit 34ac3c3

Please sign in to comment.