All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: sst_platform: Fix lock acquring
@ 2011-04-08  7:38 Lu Guanqun
  2011-04-08  7:40 ` Lu Guanqun
  2011-04-11 20:15 ` Mark Brown
  0 siblings, 2 replies; 7+ messages in thread
From: Lu Guanqun @ 2011-04-08  7:38 UTC (permalink / raw)
  To: ALSA; +Cc: Koul Vinod, Takashi Iwai, Liam Girdwood, Harsha Priya, Mark Brown

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;
 }

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-04-11 20:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-08  7:38 [PATCH] ASoC: sst_platform: Fix lock acquring Lu Guanqun
2011-04-08  7:40 ` 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

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.