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

[PATCH 01/50] USB: devio: spin_lock in complete() cleanup

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

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

Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Ming Lei <redacted>
---
 drivers/usb/core/devio.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 0598650..21e6ec6 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -495,8 +495,9 @@ static void async_completed(struct urb *urb)
 	u32 secid = 0;
 	const struct cred *cred = NULL;
 	int signr;
+	unsigned long flags;
 
-	spin_lock(&ps->lock);
+	spin_lock_irqsave(&ps->lock, flags);
 	list_move_tail(&as->asynclist, &ps->async_completed);
 	as->status = urb->status;
 	signr = as->signr;
@@ -518,7 +519,7 @@ static void async_completed(struct urb *urb)
 	if (as->status < 0 && as->bulk_addr && as->status != -ECONNRESET &&
 			as->status != -ENOENT)
 		cancel_bulk_urbs(ps, as->bulk_addr);
-	spin_unlock(&ps->lock);
+	spin_unlock_irqrestore(&ps->lock, flags);
 
 	if (signr) {
 		kill_pid_info_as_cred(sinfo.si_signo, &sinfo, pid, cred, secid);
-- 
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