Skip to content

Commit 7ff1116

Browse files
matnymangregkh
authored andcommitted
xhci: handle some XHCI_TRUST_TX_LENGTH quirks cases as default behaviour.
xhci driver claims it needs XHCI_TRUST_TX_LENGTH quirk for both Broadcom/Cavium and a Renesas xHC controllers. The quirk was inteded for handling false "success" complete event for transfers that had data left untransferred. These transfers should complete with "short packet" events instead. In these two new cases the false "success" completion is reported after a "short packet" if the TD consists of several TRBs. xHCI specs 4.10.1.1.2 say remaining TRBs should report "short packet" as well after the first short packet in a TD, but this issue seems so common it doesn't make sense to add the quirk for all vendors. Turn these events into short packets automatically instead. This gets rid of the "The WARN Successful completion on short TX for slot 1 ep 1: needs XHCI_TRUST_TX_LENGTH quirk" warning in many cases. Cc: <[email protected]> Reported-by: Eli Billauer <[email protected]> Reported-by: Ard Biesheuvel <[email protected]> Tested-by: Eli Billauer <[email protected]> Tested-by: Ard Biesheuvel <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 7c67cf6 commit 7ff1116

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/usb/host/xhci-ring.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2381,7 +2381,8 @@ static int handle_tx_event(struct xhci_hcd *xhci,
23812381
case COMP_SUCCESS:
23822382
if (EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)) == 0)
23832383
break;
2384-
if (xhci->quirks & XHCI_TRUST_TX_LENGTH)
2384+
if (xhci->quirks & XHCI_TRUST_TX_LENGTH ||
2385+
ep_ring->last_td_was_short)
23852386
trb_comp_code = COMP_SHORT_PACKET;
23862387
else
23872388
xhci_warn_ratelimited(xhci,

0 commit comments

Comments
 (0)