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

[PATCH 44/50] sound: usb: caiaq: spin_lock in complete() cleanup

From: Ming Lei <hidden>
Date: 2013-07-11 09:12:30
Also in: alsa-devel, linux-media, linux-wireless, netdev
Subsystem: native instruments usb sound interface driver, sound, the rest · Maintainers: Daniel Mack, Jaroslav Kysela, Takashi Iwai, Linus Torvalds

Complete() will be run with interrupt enabled, so change to
spin_lock_irqsave().

Cc: Daniel Mack <zonque@gmail.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <redacted>
Cc: alsa-devel@alsa-project.org
Signed-off-by: Ming Lei <redacted>
---
 sound/usb/caiaq/audio.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c
index 7103b09..e5675ab 100644
--- a/sound/usb/caiaq/audio.c
+++ b/sound/usb/caiaq/audio.c
@@ -672,10 +672,11 @@ static void read_completed(struct urb *urb)
 		offset += len;
 
 		if (len > 0) {
-			spin_lock(&cdev->spinlock);
+			unsigned long flags;
+			spin_lock_irqsave(&cdev->spinlock, flags);
 			fill_out_urb(cdev, out, &out->iso_frame_desc[outframe]);
 			read_in_urb(cdev, urb, &urb->iso_frame_desc[frame]);
-			spin_unlock(&cdev->spinlock);
+			spin_unlock_irqrestore(&cdev->spinlock, flags);
 			check_for_elapsed_periods(cdev, cdev->sub_playback);
 			check_for_elapsed_periods(cdev, cdev->sub_capture);
 			send_it = 1;
-- 
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