usb: core: unlink urbs from the tail of the endpoint's urb_list
authorBin Liu <b-liu@ti.com>
Tue, 25 Jul 2017 14:31:33 +0000 (09:31 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Aug 2017 20:43:21 +0000 (13:43 -0700)
commit42d65cc89a2338c8d488cba8a8625951fac7b0a8
treeb33ef9a95ab8ab8c6473138e3649c3cdc7b063ac
parent7c2beb1c44326ecf61c49df4a87a7c75fc255b8a
usb: core: unlink urbs from the tail of the endpoint's urb_list

commit 2eac13624364db5b5e1666ae0bb3a4d36bc56b6e 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: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/hcd.c