Commit 42d65cc8 authored by Bin Liu's avatar Bin Liu Committed by Greg Kroah-Hartman

usb: core: unlink urbs from the tail of the endpoint's urb_list

commit 2eac1362 upstream.

While unlink an urb, if the urb has been programmed in the controller,
the controller driver might do some hw related actions to tear down the
urb.

Currently usb_hcd_flush_endpoint() passes each urb from the head of the
endpoint's urb_list to the controller driver, which could make the
controller driver think each urb has been programmed and take the
unnecessary actions for each urb.

This patch changes the behavior in usb_hcd_flush_endpoint() to pass the
urbs from the tail of the list, to avoid any unnecessary actions in an
controller driver.
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarBin Liu <b-liu@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7c2beb1c
...@@ -1877,7 +1877,7 @@ void usb_hcd_flush_endpoint(struct usb_device *udev, ...@@ -1877,7 +1877,7 @@ void usb_hcd_flush_endpoint(struct usb_device *udev,
/* No more submits can occur */ /* No more submits can occur */
spin_lock_irq(&hcd_urb_list_lock); spin_lock_irq(&hcd_urb_list_lock);
rescan: rescan:
list_for_each_entry (urb, &ep->urb_list, urb_list) { list_for_each_entry_reverse(urb, &ep->urb_list, urb_list) {
int is_in; int is_in;
if (urb->unlinked) if (urb->unlinked)
......
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