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

[PATCH 18/50] USB: serial: symbolserial: spin_lock in complete() cleanup

From: Ming Lei <hidden>
Date: 2013-07-11 09:09:02
Also in: alsa-devel, linux-media, linux-wireless, netdev
Subsystem: the rest, usb serial subsystem, usb subsystem · Maintainers: Linus Torvalds, Johan Hovold, Greg Kroah-Hartman

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

Cc: Johan Hovold <redacted>
Signed-off-by: Ming Lei <redacted>
---
 drivers/usb/serial/symbolserial.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/serial/symbolserial.c b/drivers/usb/serial/symbolserial.c
index 9b16489..b4f5cbe 100644
--- a/drivers/usb/serial/symbolserial.c
+++ b/drivers/usb/serial/symbolserial.c
@@ -41,6 +41,7 @@ static void symbol_int_callback(struct urb *urb)
 	int status = urb->status;
 	int result;
 	int data_length;
+	unsigned long flags;
 
 	switch (status) {
 	case 0:
@@ -81,7 +82,7 @@ static void symbol_int_callback(struct urb *urb)
 	}
 
 exit:
-	spin_lock(&priv->lock);
+	spin_lock_irqsave(&priv->lock, flags);
 
 	/* Continue trying to always read if we should */
 	if (!priv->throttled) {
@@ -92,7 +93,7 @@ exit:
 							__func__, result);
 	} else
 		priv->actually_throttled = true;
-	spin_unlock(&priv->lock);
+	spin_unlock_irqrestore(&priv->lock, flags);
 }
 
 static int symbol_open(struct tty_struct *tty, struct usb_serial_port *port)
-- 
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