Skip to contentSkip to conversation

OMAP: ASoC: Fix spinlock misuse in omap-pcm.c

PATCH In review Jarkko Nikula 2 participants 2 messages Feb 2, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 OMAP: ASoC: Fix spinlock misuse in omap-pcm.c

From: Eero Nurkkala <[email protected]>

omap_pcm_trigger is called also in interrupt context so CPU flags must be restored when returning.

---
 sound/soc/omap/omap-pcm.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
sound/soc/omap/omap-pcm.c +3 -2
index b0362df..dd3bb29 100644
@@ -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;
 }
Signature · 1 line
1.5.6.5