aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBin Liu <b-liu@ti.com>2017-07-25 10:31:33 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-07-30 10:18:27 -0400
commit2eac13624364db5b5e1666ae0bb3a4d36bc56b6e (patch)
treec3d4409cadbd0452aa3c14f8228d7bf89fc24576
parent8b52291a0743fc4db4a7495c846a6f31ee84d282 (diff)
usb: core: unlink urbs from the tail of the endpoint's urb_list
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. Cc: stable@vger.kernel.org # v4.4+ Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Bin Liu <b-liu@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/core/hcd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index e518f6438877..7f277b092b5b 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -1888,7 +1888,7 @@ void usb_hcd_flush_endpoint(struct usb_device *udev,
1888 /* No more submits can occur */ 1888 /* No more submits can occur */
1889 spin_lock_irq(&hcd_urb_list_lock); 1889 spin_lock_irq(&hcd_urb_list_lock);
1890rescan: 1890rescan:
1891 list_for_each_entry (urb, &ep->urb_list, urb_list) { 1891 list_for_each_entry_reverse(urb, &ep->urb_list, urb_list) {
1892 int is_in; 1892 int is_in;
1893 1893
1894 if (urb->unlinked) 1894 if (urb->unlinked)