diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2007-11-21 18:13:10 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-11-28 16:58:35 -0500 |
commit | ddc1fd6ac1f3ad3275e19451fb07d2eff249161c (patch) | |
tree | b7e8512f25e22f8996dfcefbeb31ff6e7e7215e2 /drivers/usb | |
parent | 6372594ac1779261926f2f2c4ef5e79936e4faef (diff) |
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: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/core/hcd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index fea8256a18d6..d5ed3fa9e304 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -1311,8 +1311,8 @@ void usb_hcd_flush_endpoint(struct usb_device *udev, | |||
1311 | hcd = bus_to_hcd(udev->bus); | 1311 | hcd = bus_to_hcd(udev->bus); |
1312 | 1312 | ||
1313 | /* No more submits can occur */ | 1313 | /* No more submits can occur */ |
1314 | rescan: | ||
1315 | spin_lock_irq(&hcd_urb_list_lock); | 1314 | spin_lock_irq(&hcd_urb_list_lock); |
1315 | rescan: | ||
1316 | list_for_each_entry (urb, &ep->urb_list, urb_list) { | 1316 | list_for_each_entry (urb, &ep->urb_list, urb_list) { |
1317 | int is_in; | 1317 | int is_in; |
1318 | 1318 | ||
@@ -1345,6 +1345,7 @@ rescan: | |||
1345 | usb_put_urb (urb); | 1345 | usb_put_urb (urb); |
1346 | 1346 | ||
1347 | /* list contents may have changed */ | 1347 | /* list contents may have changed */ |
1348 | spin_lock(&hcd_urb_list_lock); | ||
1348 | goto rescan; | 1349 | goto rescan; |
1349 | } | 1350 | } |
1350 | spin_unlock_irq(&hcd_urb_list_lock); | 1351 | spin_unlock_irq(&hcd_urb_list_lock); |