Revert "xhci: Handle spurious events on Etron host isoc enpoints"

This reverts commit 635be13606 which is
commit b331a3d8097fad4e541d212684192f21fedbd6e5 upstream.

It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.

Bug: 161946584
Change-Id: Iee1d0a1d9c4fb65fab9319bd0d7e8bededdec273
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2025-05-21 10:09:19 +00:00
parent afca077cf3
commit d21d9b7966
2 changed files with 13 additions and 27 deletions

View File

@@ -2645,22 +2645,6 @@ static int handle_transferless_tx_event(struct xhci_hcd *xhci, struct xhci_virt_
return 0;
}
static bool xhci_spurious_success_tx_event(struct xhci_hcd *xhci,
struct xhci_ring *ring)
{
switch (ring->old_trb_comp_code) {
case COMP_SHORT_PACKET:
return xhci->quirks & XHCI_SPURIOUS_SUCCESS;
case COMP_USB_TRANSACTION_ERROR:
case COMP_BABBLE_DETECTED_ERROR:
case COMP_ISOCH_BUFFER_OVERRUN:
return xhci->quirks & XHCI_ETRON_HOST &&
ring->type == TYPE_ISOC;
default:
return false;
}
}
/*
* If this function returns an error condition, it means it got a Transfer
* event with a corrupted Slot ID, Endpoint ID, or TRB DMA address.
@@ -2715,8 +2699,8 @@ static int handle_tx_event(struct xhci_hcd *xhci,
case COMP_SUCCESS:
if (EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)) != 0) {
trb_comp_code = COMP_SHORT_PACKET;
xhci_dbg(xhci, "Successful completion on short TX for slot %u ep %u with last td comp code %d\n",
slot_id, ep_index, ep_ring->old_trb_comp_code);
xhci_dbg(xhci, "Successful completion on short TX for slot %u ep %u with last td short %d\n",
slot_id, ep_index, ep_ring->last_td_was_short);
}
break;
case COMP_SHORT_PACKET:
@@ -2870,7 +2854,7 @@ static int handle_tx_event(struct xhci_hcd *xhci,
if (trb_comp_code != COMP_STOPPED &&
trb_comp_code != COMP_STOPPED_LENGTH_INVALID &&
!ring_xrun_event &&
!xhci_spurious_success_tx_event(xhci, ep_ring)) {
!ep_ring->last_td_was_short) {
xhci_warn(xhci, "Event TRB for slot %u ep %u with no TDs queued\n",
slot_id, ep_index);
}
@@ -2922,12 +2906,11 @@ static int handle_tx_event(struct xhci_hcd *xhci,
/*
* Some hosts give a spurious success event after a short
* transfer or error on last TRB. Ignore it.
* transfer. Ignore it.
*/
if (xhci_spurious_success_tx_event(xhci, ep_ring)) {
xhci_dbg(xhci, "Spurious event dma %pad, comp_code %u after %u\n",
&ep_trb_dma, trb_comp_code, ep_ring->old_trb_comp_code);
ep_ring->old_trb_comp_code = trb_comp_code;
if ((xhci->quirks & XHCI_SPURIOUS_SUCCESS) &&
ep_ring->last_td_was_short) {
ep_ring->last_td_was_short = false;
return 0;
}
@@ -2955,12 +2938,15 @@ static int handle_tx_event(struct xhci_hcd *xhci,
*/
} while (ep->skip);
ep_ring->old_trb_comp_code = trb_comp_code;
/* Get out if a TD was queued at enqueue after the xrun occurred */
if (ring_xrun_event)
return 0;
if (trb_comp_code == COMP_SHORT_PACKET)
ep_ring->last_td_was_short = true;
else
ep_ring->last_td_was_short = false;
ep_trb = &ep_seg->trbs[(ep_trb_dma - ep_seg->dma) / sizeof(*ep_trb)];
trace_xhci_handle_transfer(ep_ring, (struct xhci_generic_trb *) ep_trb);

View File

@@ -1373,7 +1373,7 @@ struct xhci_ring {
unsigned int num_trbs_free; /* used only by xhci DbC */
unsigned int bounce_buf_len;
enum xhci_ring_type type;
u32 old_trb_comp_code;
bool last_td_was_short;
struct radix_tree_root *trb_address_map;
ANDROID_KABI_RESERVE(1);