Skip to content

Commit

Permalink
OMAP: ASoC: Fix spinlock misuse in omap-pcm.c
Browse files Browse the repository at this point in the history
omap_pcm_trigger is called also in interrupt context so CPU flags must
be restored when returning.

Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Acked-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Eero Nurkkala authored and Mark Brown committed Feb 2, 2009
1 parent ef390c0 commit 21dff43
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sound/soc/omap/omap-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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;
}
Expand Down

0 comments on commit 21dff43

Please sign in to comment.