Re: [linux-usb-devel] USB HCD: avoid duplicate local_irq_disable()

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Arnd Bergmann <arnd@...>
Cc: <linux-arch@...>, <linux-usb-devel@...>, <matthew@...>, Peter Zijlstra <peterz@...>, <gregkh@...>, LKML <linux-kernel@...>, <ralf@...>, <adobriyan@...>, Andrew Morton <akpm@...>, <viro@...>, <viro@...>, Ingo Molnar <mingo@...>, Linus Torvalds <torvalds@...>, Thomas Gleixner <tglx@...>
Date: Tuesday, October 23, 2007 - 12:01 am

On Tue, 23 Oct 2007, Arnd Bergmann wrote:


I agree with your sentiment, but it would be better to solve this 
problem without using local_irq_disable().  The patch below does this.

---

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>

Index: usb-2.6/drivers/usb/core/hcd.c
===================================================================
--- usb-2.6.orig/drivers/usb/core/hcd.c
+++ usb-2.6/drivers/usb/core/hcd.c
@@ -1312,8 +1312,8 @@ void usb_hcd_flush_endpoint(struct usb_d
 	hcd = bus_to_hcd(udev->bus);
 
 	/* No more submits can occur */
-rescan:
 	spin_lock_irq(&hcd_urb_list_lock);
+rescan:
 	list_for_each_entry (urb, &ep->urb_list, urb_list) {
 		int	is_in;
 
@@ -1346,6 +1346,7 @@ rescan:
 		usb_put_urb (urb);
 
 		/* list contents may have changed */
+		spin_lock(&hcd_urb_list_lock);
 		goto rescan;
 	}
 	spin_unlock_irq(&hcd_urb_list_lock);


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [linux-usb-devel] USB HCD: avoid duplicate local_irq_dis..., Alan Stern, (Tue Oct 23, 12:01 am)