Commit ddc1fd6a authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

USB HCD: avoid duplicate local_irq_disable()

Arnd Bergmann wrote:

usb_hcd_flush_endpoint() has a retry loop that starts with a spin_lock_irq(),
but only gives up the spinlock, not the irq_disable before jumping to the
rescan label.

Alan Stern:

I agree with your sentiment, but it would be better to solve this
problem without using local_irq_disable().
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 6372594a
...@@ -1311,8 +1311,8 @@ void usb_hcd_flush_endpoint(struct usb_device *udev, ...@@ -1311,8 +1311,8 @@ void usb_hcd_flush_endpoint(struct usb_device *udev,
hcd = bus_to_hcd(udev->bus); hcd = bus_to_hcd(udev->bus);
/* No more submits can occur */ /* No more submits can occur */
rescan:
spin_lock_irq(&hcd_urb_list_lock); spin_lock_irq(&hcd_urb_list_lock);
rescan:
list_for_each_entry (urb, &ep->urb_list, urb_list) { list_for_each_entry (urb, &ep->urb_list, urb_list) {
int is_in; int is_in;
...@@ -1345,6 +1345,7 @@ rescan: ...@@ -1345,6 +1345,7 @@ rescan:
usb_put_urb (urb); usb_put_urb (urb);
/* list contents may have changed */ /* list contents may have changed */
spin_lock(&hcd_urb_list_lock);
goto rescan; goto rescan;
} }
spin_unlock_irq(&hcd_urb_list_lock); spin_unlock_irq(&hcd_urb_list_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment