From: Liam Girdwood <lrg@ti.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: alsa-devel@alsa-project.org, Liam Girdwood <lrg@ti.com>
Subject: [PATCH 1/3] ASoC: core: Add card mutex locking subclasses
Date: Wed, 7 Mar 2012 10:38:25 +0000 [thread overview]
Message-ID: <1331116707-10016-1-git-send-email-lrg@ti.com> (raw)
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: Liam Girdwood <lrg@ti.com>
---
include/sound/soc.h | 5 +++++
sound/soc/soc-core.c | 2 +-
2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 2ebf787..70de2f8 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -288,6 +288,11 @@ enum snd_soc_pcm_subclass {
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 source, unsigned int freq, int dir);
int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source,
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index c90bb01..acd0d93 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1416,7 +1416,7 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
struct snd_soc_dai_link *dai_link;
int ret, i, order;
- mutex_lock(&card->mutex);
+ mutex_lock_nested(&card->mutex, SND_SOC_CARD_CLASS_INIT);
if (card->instantiated) {
mutex_unlock(&card->mutex);
--
1.7.5.4
next reply other threads:[~2012-03-07 10:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-07 10:38 Liam Girdwood [this message]
2012-03-07 10:38 ` [PATCH 2/3] ASoC: dapm: Use DAPM mutex for DAPM ops instead of codec mutex Liam Girdwood
2012-03-07 19:46 ` Mark Brown
2012-03-08 11:23 ` Liam Girdwood
2012-03-07 10:38 ` [PATCH 3/3] ASoC: dapm: lock mixer & mux update power with DAPM mutex Liam Girdwood
2012-03-07 19:48 ` Mark Brown
2012-03-07 19:44 ` [PATCH 1/3] ASoC: core: Add card mutex locking subclasses Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1331116707-10016-1-git-send-email-lrg@ti.com \
--to=lrg@ti.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).