diff options
| author | Rohit kumar <rohitkr@codeaurora.org> | 2019-01-10 04:02:41 -0500 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2019-01-10 07:04:28 -0500 |
| commit | 04eb1efcd614d6f067b76a355b3a3599667959dc (patch) | |
| tree | b4dd9ac4334e2bfab318d55c6f3bec2a94b03dc4 | |
| parent | 239b8b34a856777e562373ae0de605536a7ccade (diff) | |
ASoC: soc-core: Hold client_mutex around soc_init_dai_link()
soc_init_dai_link() calls soc_find_component() which needs
to be within client_mutex lock. Add client_mutex lock around
soc_init_dai_link() in snd_soc_register_card() to avoid
lockdep warning.
Fixes: 8780cf1142a5 ("ASoC: soc-core: defer card probe until all component is added to list")
Reported-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
Signed-off-by: Ajit Pandey <ajitp@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
| -rw-r--r-- | sound/soc/soc-core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index eec92f17dd15..0934b36645b3 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
| @@ -1027,6 +1027,7 @@ static int snd_soc_init_platform(struct snd_soc_card *card, | |||
| 1027 | struct snd_soc_dai_link *dai_link) | 1027 | struct snd_soc_dai_link *dai_link) |
| 1028 | { | 1028 | { |
| 1029 | struct snd_soc_dai_link_component *platform = dai_link->platform; | 1029 | struct snd_soc_dai_link_component *platform = dai_link->platform; |
| 1030 | |||
| 1030 | /* | 1031 | /* |
| 1031 | * FIXME | 1032 | * FIXME |
| 1032 | * | 1033 | * |
| @@ -2754,15 +2755,18 @@ int snd_soc_register_card(struct snd_soc_card *card) | |||
| 2754 | if (!card->name || !card->dev) | 2755 | if (!card->name || !card->dev) |
| 2755 | return -EINVAL; | 2756 | return -EINVAL; |
| 2756 | 2757 | ||
| 2758 | mutex_lock(&client_mutex); | ||
| 2757 | for_each_card_prelinks(card, i, link) { | 2759 | for_each_card_prelinks(card, i, link) { |
| 2758 | 2760 | ||
| 2759 | ret = soc_init_dai_link(card, link); | 2761 | ret = soc_init_dai_link(card, link); |
| 2760 | if (ret) { | 2762 | if (ret) { |
| 2761 | dev_err(card->dev, "ASoC: failed to init link %s\n", | 2763 | dev_err(card->dev, "ASoC: failed to init link %s\n", |
| 2762 | link->name); | 2764 | link->name); |
| 2765 | mutex_unlock(&client_mutex); | ||
| 2763 | return ret; | 2766 | return ret; |
| 2764 | } | 2767 | } |
| 2765 | } | 2768 | } |
| 2769 | mutex_unlock(&client_mutex); | ||
| 2766 | 2770 | ||
| 2767 | dev_set_drvdata(card->dev, card); | 2771 | dev_set_drvdata(card->dev, card); |
| 2768 | 2772 | ||
