Commit 01b9d99a authored by Liam Girdwood's avatar Liam Girdwood Committed by Mark Brown

ASoC: core: Add card mutex locking subclasses

This is the first part of a change that is intended to improve
ASoC locking protection for DAPM and PCM operations.

This part of the series adds a mutex class for the soc_card mutex. The
SND_SOC_CARD_CLASS_INIT class is used for card initialisation only whilst the
SND_SOC_CARD_CLASS_PCM class is used for the forth coming Dynamic
PCM operations. The new mutex classes are required otherwise we will see a false
positive mutex deadlock warning between the card initialisation and the PCM
operations (something that would never deadlock in real life).
Signed-off-by: default avatarLiam Girdwood <lrg@ti.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 253322c1
...@@ -288,6 +288,11 @@ enum snd_soc_pcm_subclass { ...@@ -288,6 +288,11 @@ enum snd_soc_pcm_subclass {
SND_SOC_PCM_CLASS_BE = 1, SND_SOC_PCM_CLASS_BE = 1,
}; };
enum snd_soc_card_subclass {
SND_SOC_CARD_CLASS_INIT = 0,
SND_SOC_CARD_CLASS_PCM = 1,
};
int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id, int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id,
int source, unsigned int freq, int dir); int source, unsigned int freq, int dir);
int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source, int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source,
......
...@@ -1416,7 +1416,7 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card) ...@@ -1416,7 +1416,7 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
struct snd_soc_dai_link *dai_link; struct snd_soc_dai_link *dai_link;
int ret, i, order; int ret, i, order;
mutex_lock(&card->mutex); mutex_lock_nested(&card->mutex, SND_SOC_CARD_CLASS_INIT);
if (card->instantiated) { if (card->instantiated) {
mutex_unlock(&card->mutex); mutex_unlock(&card->mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment