linux/drivers/usb
Mathias Nyman b331a3d809 xhci: Handle spurious events on Etron host isoc enpoints
Unplugging a USB3.0 webcam from Etron hosts while streaming results
in errors like this:

[ 2.646387] xhci_hcd 0000:03:00.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 18 comp_code 13
[ 2.646446] xhci_hcd 0000:03:00.0: Looking for event-dma 000000002fdf8630 trb-start 000000002fdf8640 trb-end 000000002fdf8650
[ 2.646560] xhci_hcd 0000:03:00.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 18 comp_code 13
[ 2.646568] xhci_hcd 0000:03:00.0: Looking for event-dma 000000002fdf8660 trb-start 000000002fdf8670 trb-end 000000002fdf8670

Etron xHC generates two transfer events for the TRB if an error is
detected while processing the last TRB of an isoc TD.

The first event can be any sort of error (like USB Transaction or
Babble Detected, etc), and the final event is Success.

The xHCI driver will handle the TD after the first event and remove it
from its internal list, and then print an "Transfer event TRB DMA ptr
not part of current TD" error message after the final event.

Commit 5372c65e13 ("xhci: process isoc TD properly when there was a
transaction error mid TD.") is designed to address isoc transaction
errors, but unfortunately it doesn't account for this scenario.

This issue is similar to the XHCI_SPURIOUS_SUCCESS case where a success
event follows a 'short transfer' event, but the TD the event points to
is already given back.

Expand the spurious success 'short transfer' event handling to cover
the spurious success after error on Etron hosts.

Kuangyi Chiang reported this issue and submitted a different solution
based on using error_mid_td. This commit message is mostly taken
from that patch.

Reported-by: Kuangyi Chiang <ki.chiang65@gmail.com>
Closes: https://lore.kernel.org/linux-usb/20241028025337.6372-6-ki.chiang65@gmail.com/
Tested-by: Kuangyi Chiang <ki.chiang65@gmail.com>
Tested-by: Michal Pecio <michal.pecio@gmail.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20250306144954.3507700-16-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-03-06 16:46:16 +01:00
..
atm Merge 6.12-rc3 into usb-next 2024-10-14 08:03:44 +02:00
c67x00 usb: Switch back to struct platform_driver::remove() 2024-10-04 15:13:03 +02:00
cdns3 USB: Use str_enable_disable-like helpers 2025-01-15 18:28:13 +01:00
chipidea usb: chipidea: imx: fix some typo 2025-03-03 10:23:56 +01:00
class USB: cdc-acm: Fill in Renesas R-Car D3 USB Download mode quirk 2025-02-14 09:22:36 +01:00
common USB: Use str_enable_disable-like helpers 2025-01-15 18:28:13 +01:00
core usb: core: replace usb_sndaddr0pipe macro with usb_sndctrlpipe 2025-03-03 10:23:19 +01:00
dwc2 usb: dwc2: Implement recovery after PM domain off 2025-02-19 15:15:54 +01:00
dwc3 usb: dwc3: exynos: add support for exynos7870 2025-03-03 10:25:11 +01:00
early
fotg210 USB: Use str_enable_disable-like helpers 2025-01-15 18:28:13 +01:00
gadget Merge 6.14-rc3 into usb-next 2025-02-17 07:33:47 +01:00
host xhci: Handle spurious events on Etron host isoc enpoints 2025-03-06 16:46:16 +01:00
image scsi: Rename .slave_alloc() and .slave_destroy() 2024-12-04 15:34:28 -05:00
isp1760 Kbuild updates for v6.13 2024-11-30 13:41:50 -08:00
misc usb: misc: onboard_dev: add vdda support for Microchip USB2514 2025-02-19 15:14:13 +01:00
mon drivers/usb/mon: refactor min with min_t 2024-11-13 15:09:51 +01:00
mtu3 Driver core and debugfs updates 2025-01-28 12:25:12 -08:00
musb usb: musb: Constify struct musb_fifo_cfg 2025-02-03 16:29:53 +01:00
phy usb: ulpi: Remove unused otg_ulpi_create 2025-03-03 10:23:35 +01:00
renesas_usbhs usb: Use (of|device)_property_present() for non-boolean properties 2024-11-05 13:29:26 +01:00
roles usb: roles: set switch registered flag early on 2025-02-14 09:26:25 +01:00
serial USB: serial: option: drop MeiG Smart defines 2025-02-11 17:08:58 +01:00
storage usb: storage: shuttle_usbat: Use const for constant array 2025-03-03 10:24:41 +01:00
typec ucsi_ccg: Don't show non-functional attributes 2025-03-03 10:24:24 +01:00
usbip usbip: Correct format specifier for seqnum from %d to %u 2025-01-17 12:38:01 +01:00
Kconfig
Makefile
usb-skeleton.c