From: Eero Nurkkala Date: Mon, 2 Feb 2009 12:20:46 +0000 (+0200) Subject: OMAP: ASoC: Fix spinlock misuse in omap-pcm.c X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=21dff4345697ad129b0efeed1b4d0aa53dfd47fe;p=linux-beck.git OMAP: ASoC: Fix spinlock misuse in omap-pcm.c omap_pcm_trigger is called also in interrupt context so CPU flags must be restored when returning. Signed-off-by: Eero Nurkkala Acked-by: Jarkko Nikula Signed-off-by: Mark Brown --- diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c index b0362dfd5b71..dd3bb2933762 100644 --- a/sound/soc/omap/omap-pcm.c +++ b/sound/soc/omap/omap-pcm.c @@ -175,9 +175,10 @@ static int omap_pcm_trigger(struct snd_pcm_substream *substream, int cmd) { struct snd_pcm_runtime *runtime = substream->runtime; struct omap_runtime_data *prtd = runtime->private_data; + unsigned long flags; int ret = 0; - spin_lock_irq(&prtd->lock); + spin_lock_irqsave(&prtd->lock, flags); switch (cmd) { case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: @@ -195,7 +196,7 @@ static int omap_pcm_trigger(struct snd_pcm_substream *substream, int cmd) default: ret = -EINVAL; } - spin_unlock_irq(&prtd->lock); + spin_unlock_irqrestore(&prtd->lock, flags); return ret; }