From: Lu Guanqun <guanqun.lu@intel.com>
To: ALSA <alsa-devel@alsa-project.org>
Cc: Koul Vinod <vinod.koul@intel.com>, Takashi Iwai <tiwai@suse.de>,
Liam Girdwood <lrg@slimlogic.co.uk>,
Harsha Priya <priya.harsha@intel.com>,
Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: [PATCH] ASoC: sst_platform: Fix lock acquring
Date: Fri, 08 Apr 2011 15:38:48 +0800 [thread overview]
Message-ID: <20110408073848.30438.39586.stgit@localhost> (raw)
Fix the possible dead lock shown below:
spin_lock
sst_get_stream_status
sst_period_elapsed
intel_sst_interrupt
handle_IRQ_event
handle_fasteoi_irq
do_IRQ
common_interrupt
spin_lock
sst_set_stream_status
sst_platform_pcm_trigger
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
---
sound/soc/mid-x86/sst_platform.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/sound/soc/mid-x86/sst_platform.c b/sound/soc/mid-x86/sst_platform.c
index 9ba9414..d827edb 100644
--- a/sound/soc/mid-x86/sst_platform.c
+++ b/sound/soc/mid-x86/sst_platform.c
@@ -116,18 +116,20 @@ struct snd_soc_dai_driver sst_platform_dai[] = {
static inline void sst_set_stream_status(struct sst_runtime_stream *stream,
int state)
{
- spin_lock(&stream->status_lock);
+ unsigned long flags;
+ spin_lock_irqsave(&stream->status_lock, flags);
stream->stream_status = state;
- spin_unlock(&stream->status_lock);
+ spin_unlock_irqrestore(&stream->status_lock, flags);
}
static inline int sst_get_stream_status(struct sst_runtime_stream *stream)
{
int state;
+ unsigned long flags;
- spin_lock(&stream->status_lock);
+ spin_lock_irqsave(&stream->status_lock, flags);
state = stream->stream_status;
- spin_unlock(&stream->status_lock);
+ spin_unlock_irqrestore(&stream->status_lock, flags);
return state;
}
next reply other threads:[~2011-04-08 7:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-08 7:38 Lu Guanqun [this message]
2011-04-08 7:40 ` [PATCH] ASoC: sst_platform: Fix lock acquring Lu Guanqun
2011-04-09 4:51 ` Koul, Vinod
2011-04-09 10:22 ` Lu Guanqun
2011-04-09 10:41 ` Lu Guanqun
2011-04-11 19:52 ` Liam Girdwood
2011-04-11 20:15 ` 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=20110408073848.30438.39586.stgit@localhost \
--to=guanqun.lu@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=lrg@slimlogic.co.uk \
--cc=priya.harsha@intel.com \
--cc=tiwai@suse.de \
--cc=vinod.koul@intel.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 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.