Thread (71 messages) 71 messages, 8 authors, 2013-07-27
STALE4714d

[PATCH 46/50] Sound: usb: ua101: spin_lock in complete() cleanup

From: Ming Lei <hidden>
Date: 2013-07-11 09:12:46
Also in: alsa-devel, linux-input, linux-media, linux-wireless
Subsystem: edirol ua-101/ua-1000 driver, sound, the rest · Maintainers: Clemens Ladisch, Jaroslav Kysela, Takashi Iwai, Linus Torvalds

Complete() will be run with interrupt enabled, so disable local
interrupt before holding a global lock which is held without irqsave.

Cc: Clemens Ladisch <clemens-P6GI/4k7KOmELgA04lAiVw@public.gmane.org>
Cc: Jaroslav Kysela <perex-/Fr2/VpizcU@public.gmane.org>
Cc: Takashi Iwai <redacted>
Cc: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org
Signed-off-by: Ming Lei <redacted>
---
 sound/usb/misc/ua101.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/sound/usb/misc/ua101.c b/sound/usb/misc/ua101.c
index 8b5d2c5..52a60c6 100644
--- a/sound/usb/misc/ua101.c
+++ b/sound/usb/misc/ua101.c
@@ -613,14 +613,24 @@ static int start_usb_playback(struct ua101 *ua)
 
 static void abort_alsa_capture(struct ua101 *ua)
 {
-	if (test_bit(ALSA_CAPTURE_RUNNING, &ua->states))
+	if (test_bit(ALSA_CAPTURE_RUNNING, &ua->states)) {
+		unsigned long flags;
+
+		local_irq_save(flags);
 		snd_pcm_stop(ua->capture.substream, SNDRV_PCM_STATE_XRUN);
+		local_irq_restore(flags);
+	}
 }
 
 static void abort_alsa_playback(struct ua101 *ua)
 {
-	if (test_bit(ALSA_PLAYBACK_RUNNING, &ua->states))
+	if (test_bit(ALSA_PLAYBACK_RUNNING, &ua->states)) {
+		unsigned long flags;
+
+		local_irq_save(flags);
 		snd_pcm_stop(ua->playback.substream, SNDRV_PCM_STATE_XRUN);
+		local_irq_restore(flags);
+	}
 }
 
 static int set_stream_hw(struct ua101 *ua, struct snd_pcm_substream *substream,
-- 
1.7.9.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help