kernel_samsung_a53x/drivers/usb
Michal Pecio 5f2b55b75f xhci: handle isoc Babble and Buffer Overrun events properly
[ Upstream commit 7c4650ded49e5b88929ecbbb631efb8b0838e811 ]

xHCI 4.9 explicitly forbids assuming that the xHC has released its
ownership of a multi-TRB TD when it reports an error on one of the
early TRBs. Yet the driver makes such assumption and releases the TD,
allowing the remaining TRBs to be freed or overwritten by new TDs.

The xHC should also report completion of the final TRB due to its IOC
flag being set by us, regardless of prior errors. This event cannot
be recognized if the TD has already been freed earlier, resulting in
"Transfer event TRB DMA ptr not part of current TD" error message.

Fix this by reusing the logic for processing isoc Transaction Errors.
This also handles hosts which fail to report the final completion.

Fix transfer length reporting on Babble errors. They may be caused by
device malfunction, no guarantee that the buffer has been filled.

Signed-off-by: Michal Pecio <michal.pecio@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20240125152737.2983959-5-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-18 23:19:51 +01:00
..
atm
c67x00
cdns3 usb: cdns3: fix memory double free when handle zero packet 2024-11-18 22:25:39 +01:00
chipidea usb: chipidea: wait controller resume finished for wakeup irq 2024-11-18 12:12:46 +01:00
class usb: cdc-acm: return correct error code on unsupported break 2024-11-18 12:12:50 +01:00
common
core USB: hub: check for alternate port before enabling A_ALT_HNP_SUPPORT 2024-11-18 12:13:29 +01:00
dwc2
dwc3 usb: dwc: ep0: Update request status in dwc3_ep0_stall_restart 2024-11-18 12:12:46 +01:00
early
gadget usb: gadget: ncm: Avoid dropping datagrams of properly parsed NTBs 2024-11-18 22:25:39 +01:00
host xhci: handle isoc Babble and Buffer Overrun events properly 2024-11-18 23:19:51 +01:00
image
isp1760
misc
mon usb: mon: Fix atomicity violation in mon_bin_vma_fault 2024-11-18 12:12:47 +01:00
mtu3
musb
notify
notify_lsi
phy usb: phy: mxs: remove CONFIG_USB_OTG condition for mxs_phy_is_otg_host() 2024-11-18 12:12:46 +01:00
renesas_usbhs
roles usb: roles: don't get/set_role() when usb_role_switch is unregistered 2024-11-18 22:25:39 +01:00
serial USB: serial: cp210x: add ID for IMST iM871A-USB 2024-11-18 12:13:26 +01:00
storage
typec usb: ucsi_acpi: Fix command completion handling 2024-11-18 12:13:29 +01:00
usbip
Kconfig
Kconfig.variant1
Makefile
Makefile.variant1
usb-skeleton.c