Commit 810a624b authored by Lu Baolu's avatar Lu Baolu Committed by Greg Kroah-Hartman

usb: xhci: Reset halted endpoint if trb is noop

When a URB is cancled, xhci driver turns the untransferred trbs
into no-ops.  If an endpoint stalls on a no-op trb that belongs
to the cancelled URB, the event handler won't reset the endpoint.
Hence, it will stay halted.

Link: http://marc.info/?l=linux-usb&m=149582598330127&w=2

Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d1aad52c
...@@ -2580,15 +2580,21 @@ static int handle_tx_event(struct xhci_hcd *xhci, ...@@ -2580,15 +2580,21 @@ static int handle_tx_event(struct xhci_hcd *xhci,
(struct xhci_generic_trb *) ep_trb); (struct xhci_generic_trb *) ep_trb);
/* /*
* No-op TRB should not trigger interrupts. * No-op TRB could trigger interrupts in a case where
* If ep_trb is a no-op TRB, it means the * a URB was killed and a STALL_ERROR happens right
* corresponding TD has been cancelled. Just ignore * after the endpoint ring stopped. Reset the halted
* the TD. * endpoint. Otherwise, the endpoint remains stalled
* indefinitely.
*/ */
if (trb_is_noop(ep_trb)) { if (trb_is_noop(ep_trb)) {
xhci_dbg(xhci, if (trb_comp_code == COMP_STALL_ERROR ||
"ep_trb is a no-op TRB. Skip it for slot %u ep %u\n", xhci_requires_manual_halt_cleanup(xhci, ep_ctx,
slot_id, ep_index); trb_comp_code))
xhci_cleanup_halted_endpoint(xhci, slot_id,
ep_index,
ep_ring->stream_id,
td, ep_trb,
EP_HARD_RESET);
goto cleanup; goto cleanup;
} }
......
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