kernel_samsung_a53x/drivers/usb/host
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
..
bcma-hcd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-atmel.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-brcm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-dbg.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-exynos.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-fsl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-fsl.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-grlib.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-hcd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-hub.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-mem.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-mv.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-mxc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-npcm7xx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-omap.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-orion.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-pci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-platform.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-pmcmsp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-ppc-of.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-ps3.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-q.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-sched.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-sh.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-spear.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-st.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-sysfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-tegra.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-timer.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci-xilinx-of.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ehci.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fhci-dbg.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fhci-hcd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fhci-hub.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fhci-mem.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fhci-q.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fhci-sched.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fhci-tds.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fhci.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fotg210-hcd.c usb: fotg210-hcd: delete an incorrect bounds test 2024-11-18 12:12:02 +01:00
fotg210.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fsl-mph-dr-of.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
imx21-dbg.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
imx21-hcd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
imx21-hcd.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
isp116x-hcd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
isp116x.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
isp1362-hcd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
isp1362.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
max3421-hcd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ohci-at91.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ohci-da8xx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ohci-dbg.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ohci-exynos.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ohci-hcd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ohci-hub.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ohci-mem.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ohci-nxp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ohci-omap.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ohci-pci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ohci-platform.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ohci-ppc-of.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ohci-ps3.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ohci-pxa27x.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ohci-q.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ohci-s3c2410.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ohci-sa1111.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ohci-sm501.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ohci-spear.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ohci-st.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ohci-tmio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ohci.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
oxu210hp-hcd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pci-quirks.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pci-quirks.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
r8a66597-hcd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
r8a66597.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sl811-hcd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sl811.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sl811_cs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ssb-hcd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
u132-hcd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uhci-debug.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uhci-grlib.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uhci-hcd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uhci-hcd.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uhci-hub.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uhci-pci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uhci-platform.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uhci-q.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci-dbg.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci-dbgcap.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci-dbgcap.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci-dbgtty.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci-debugfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci-debugfs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci-ext-caps.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci-ext-caps.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci-exynos.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci-exynos.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci-histb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci-hub.c xhci: cleanup xhci_hub_control port references 2024-11-08 11:26:12 +01:00
xhci-mem.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci-mtk-sch.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci-mtk.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci-mtk.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci-mvebu.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci-mvebu.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci-pci-renesas.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci-pci.c Revert "xhci: Loosen RPM as default policy to cover for AMD xHC 1.1" 2024-11-18 12:11:45 +01:00
xhci-pci.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci-plat.c usb: host: xhci-plat: Add support for XHCI_SG_TRB_CACHE_SIZE_QUIRK 2024-11-18 12:13:26 +01:00
xhci-plat.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci-rcar.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci-rcar.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci-ring.c xhci: handle isoc Babble and Buffer Overrun events properly 2024-11-18 23:19:51 +01:00
xhci-tegra.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci-trace.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci-trace.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xhci.h xhci: process isoc TD properly when there was a transaction error mid TD. 2024-11-18 23:19:51 +01:00