Skip to content

Commit

Permalink
ASoC: sst_platform: Fix lock acquring
Browse files Browse the repository at this point in the history
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>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Lu Guanqun authored and Mark Brown committed Apr 11, 2011
1 parent d985f27 commit d89b0a1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions sound/soc/mid-x86/sst_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit d89b0a1

Please sign in to comment.