]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
USB: xhci: Reset a halted endpoint immediately when we encounter a stall.
authorMathias Nyman <mathias.nyman@linux.intel.com>
Tue, 18 Nov 2014 09:27:12 +0000 (11:27 +0200)
committerZefan Li <lizefan@huawei.com>
Tue, 14 Apr 2015 09:33:37 +0000 (17:33 +0800)
commit991182b96557810df14a74fe7f4f4f15765afe98
treeba80e254bbc64aa377c6f35623770649a38ba6de
parenta3d7be959d2eabb53164669a4a8db3175dc31f44
USB: xhci: Reset a halted endpoint immediately when we encounter a stall.

commit 8e71a322fdb127814bcba423a512914ca5bc6cf5 upstream.

If a device is halted and reuturns a STALL, then the halted endpoint
needs to be cleared both on the host and device side. The host
side halt is cleared by issueing a xhci reset endpoint command. The device side
is cleared with a ClearFeature(ENDPOINT_HALT) request, which should
be issued by the device driver if a URB reruen -EPIPE.

Previously we cleared the host side halt after the device side was cleared.
To make sure the host side halt is cleared in time we want to issue the
reset endpoint command immedialtely when a STALL status is encountered.

Otherwise we end up not following the specs and not returning -EPIPE
several times in a row when trying to transfer data to a halted endpoint.

Fixes: bcef3fd (USB: xhci: Handle errors that cause endpoint halts.)
Tested-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[lizf: Backported to 3.4: adjust context]
Signed-off-by: Zefan Li <lizefan@huawei.com>
drivers/usb/host/xhci-ring.c
drivers/usb/host/xhci.c