1 From 28518ed66242869c1b04ab40d4e84ce5fedb0c56 Mon Sep 17 00:00:00 2001
2 From: Takashi Iwai <tiwai@suse.de>
3 Date: Thu, 11 Jul 2013 17:57:55 +0200
4 Subject: ALSA: 6fire: Fix unlocked snd_pcm_stop() call
6 From: Takashi Iwai <tiwai@suse.de>
8 commit 5b9ab3f7324a1b94a5a5a76d44cf92dfeb3b5e80 upstream.
10 snd_pcm_stop() must be called in the PCM substream lock context.
12 Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
14 Cc: Weng Meiling <wengmeiling.weng@huawei.com>
15 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18 sound/usb/6fire/pcm.c | 12 ++++++++++--
19 1 file changed, 10 insertions(+), 2 deletions(-)
21 --- a/sound/usb/6fire/pcm.c
22 +++ b/sound/usb/6fire/pcm.c
23 @@ -639,17 +639,25 @@ int __devinit usb6fire_pcm_init(struct s
24 void usb6fire_pcm_abort(struct sfire_chip *chip)
26 struct pcm_runtime *rt = chip->pcm;
27 + unsigned long flags;
33 - if (rt->playback.instance)
34 + if (rt->playback.instance) {
35 + snd_pcm_stream_lock_irqsave(rt->playback.instance, flags);
36 snd_pcm_stop(rt->playback.instance,
37 SNDRV_PCM_STATE_XRUN);
38 - if (rt->capture.instance)
39 + snd_pcm_stream_unlock_irqrestore(rt->playback.instance, flags);
42 + if (rt->capture.instance) {
43 + snd_pcm_stream_lock_irqsave(rt->capture.instance, flags);
44 snd_pcm_stop(rt->capture.instance,
45 SNDRV_PCM_STATE_XRUN);
46 + snd_pcm_stream_unlock_irqrestore(rt->capture.instance, flags);
49 for (i = 0; i < PCM_N_URBS; i++) {
50 usb_poison_urb(&rt->in_urbs[i].instance);