Skip to content

Commit a80c203

Browse files
matnymangregkh
authored andcommitted
xhci: fix giving back URB with incorrect status regression in 5.12
5.12 kernel changes how xhci handles cancelled URBs and halted endpoints. Among these changes cancelled and stalled URBs are no longer given back before they are cleared from xHC hardware cache. These changes unfortunately cleared the -EPIPE status of a stalled transfer in one case before giving bak the URB, causing a USB card reader to fail from working. Fixes: 674f843 ("xhci: split handling halted endpoints into two steps") Cc: <stable@vger.kernel.org> # 5.12 Reported-by: Peter Ganzhorn <peter.ganzhorn@googlemail.com> Tested-by: Peter Ganzhorn <peter.ganzhorn@googlemail.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20210525074100.1154090-2-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e680970 commit a80c203

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

drivers/usb/host/xhci-ring.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -828,14 +828,10 @@ static void xhci_giveback_invalidated_tds(struct xhci_virt_ep *ep)
828828
list_for_each_entry_safe(td, tmp_td, &ep->cancelled_td_list,
829829
cancelled_td_list) {
830830

831-
/*
832-
* Doesn't matter what we pass for status, since the core will
833-
* just overwrite it (because the URB has been unlinked).
834-
*/
835831
ring = xhci_urb_to_transfer_ring(ep->xhci, td->urb);
836832

837833
if (td->cancel_status == TD_CLEARED)
838-
xhci_td_cleanup(ep->xhci, td, ring, 0);
834+
xhci_td_cleanup(ep->xhci, td, ring, td->status);
839835

840836
if (ep->xhci->xhc_state & XHCI_STATE_DYING)
841837
return;

0 commit comments

Comments
 (0)