1
linux/drivers/usb/host
Mathias Nyman 30c9ae5ece xhci: dbc: honor usb transfer size boundaries.
Treat each completed full size write to /dev/ttyDBC0 as a separate usb
transfer. Make sure the size of the TRBs matches the size of the tty
write by first queuing as many max packet size TRBs as possible up to
the last TRB which will be cut short to match the size of the tty write.

This solves an issue where userspace writes several transfers back to
back via /dev/ttyDBC0 into a kfifo before dbgtty can find available
request to turn that kfifo data into TRBs on the transfer ring.

The boundary between transfer was lost as xhci-dbgtty then turned
everyting in the kfifo into as many 'max packet size' TRBs as possible.

DbC would then send more data to the host than intended for that
transfer, causing host to issue a babble error.

Refuse to write more data to kfifo until previous tty write data is
turned into properly sized TRBs with data size boundaries matching tty
write size

Tested-by: Uday M Bhat <uday.m.bhat@intel.com>
Tested-by: Łukasz Bartosik <ukaszb@chromium.org>
Cc: stable@vger.kernel.org
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20241016140000.783905-5-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-17 08:45:36 +02:00
..
bcma-hcd.c
ehci-atmel.c
ehci-brcm.c usb: ehci-brcm: fix module autoloading 2024-08-25 13:45:56 +02:00
ehci-dbg.c USB: Use EHCI control transfer pid macros instead of constant values. 2024-03-26 10:43:35 +01:00
ehci-exynos.c usb: ehci-exynos: Simplify with scoped for each OF child loop 2024-08-22 17:17:29 +08:00
ehci-fsl.c
ehci-fsl.h
ehci-grlib.c
ehci-hcd.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
ehci-hub.c
ehci-mem.c
ehci-mv.c
ehci-npcm7xx.c
ehci-omap.c
ehci-orion.c usb: host: Add ac5 to EHCI Orion 2024-01-27 16:53:51 -08:00
ehci-pci.c
ehci-platform.c
ehci-ppc-of.c
ehci-ps3.c
ehci-q.c USB: Use EHCI control transfer pid macros instead of constant values. 2024-03-26 10:43:35 +01:00
ehci-sched.c
ehci-sh.c
ehci-spear.c
ehci-st.c
ehci-sysfs.c
ehci-timer.c
ehci-xilinx-of.c
ehci.h USB: Use EHCI control transfer pid macros instead of constant values. 2024-03-26 10:43:35 +01:00
fhci-dbg.c
fhci-hcd.c
fhci-hub.c
fhci-mem.c
fhci-q.c
fhci-sched.c
fhci-tds.c
fhci.h
fsl-mph-dr-of.c usb: fsl-mph-dr-of: mark fsl_usb2_mpc5121_init() static 2023-12-10 17:21:43 -08:00
isp116x-hcd.c
isp116x.h
isp1362-hcd.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
isp1362.h
Kconfig xhci-pci: Make xhci-pci-renesas a proper modular driver 2024-08-07 12:51:38 +02:00
Makefile
max3421-hcd.c usb: host: max3421-hcd: Replace snprintf() with the safer scnprintf() variant 2023-12-15 13:55:30 +01:00
octeon-hcd.c
octeon-hcd.h
ohci-at91.c
ohci-da8xx.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
ohci-dbg.c
ohci-exynos.c usb: ohci-exynos: Simplify with scoped for each OF child loop 2024-08-22 17:17:35 +08:00
ohci-hcd.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
ohci-hub.c
ohci-mem.c
ohci-nxp.c usb: ohci-nxp: Use helper function devm_clk_get_enabled() 2024-09-03 09:53:34 +02:00
ohci-omap.c
ohci-pci.c
ohci-platform.c
ohci-ppc-of.c USB: ohci-ppc-of: Drop ohci-littledian compatible 2024-07-31 10:41:25 +02:00
ohci-ps3.c
ohci-pxa27x.c usb: ohci-pxa27x: Remove unused of_gpio.h 2024-03-07 20:58:25 +00:00
ohci-q.c
ohci-s3c2410.c
ohci-sa1111.c
ohci-sm501.c
ohci-spear.c
ohci-st.c
ohci.h usb: Annotate struct urb_priv with __counted_by 2023-10-02 09:48:52 -07:00
oxu210hp-hcd.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
pci-quirks.c usb: pci-quirks: handle HAS_IOPORT dependency for UHCI handoff 2023-10-02 16:19:13 +02:00
pci-quirks.h usb: pci-quirks: handle HAS_IOPORT dependency for AMD quirk 2023-10-02 16:19:12 +02:00
r8a66597-hcd.c usb: r8a66597-hcd: make read-only const arrays static 2024-09-13 07:41:27 +02:00
r8a66597.h
sl811_cs.c
sl811-hcd.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
sl811.h
ssb-hcd.c
uhci-debug.c
uhci-grlib.c usb: uhci-grlib: Explicitly include linux/platform_device.h 2024-02-19 09:23:00 +01:00
uhci-hcd.c
uhci-hcd.h
uhci-hub.c
uhci-pci.c
uhci-platform.c
uhci-q.c
xen-hcd.c
xhci-caps.h XHCI: Separate PORT and CAPs macros into dedicated file 2024-01-27 17:39:09 -08:00
xhci-dbg.c
xhci-dbgcap.c xhci: dbc: Fix STALL transfer event handling 2024-09-05 16:39:21 +02:00
xhci-dbgcap.h xhci: dbc: honor usb transfer size boundaries. 2024-10-17 08:45:36 +02:00
xhci-dbgtty.c xhci: dbc: honor usb transfer size boundaries. 2024-10-17 08:45:36 +02:00
xhci-debugfs.c xhci: add support to allocate several interrupters 2024-01-04 16:08:13 +01:00
xhci-debugfs.h
xhci-ext-caps.c
xhci-ext-caps.h xhci: Add USB4 tunnel detection for USB3 devices on Intel hosts 2024-09-03 09:54:39 +02:00
xhci-histb.c
xhci-hub.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
xhci-mem.c xhci: support setting interrupt moderation IMOD for secondary interrupters 2024-09-05 16:39:23 +02:00
xhci-mtk-sch.c xhci: replace real & fake port with pointer to root hub port 2024-03-02 20:25:27 +01:00
xhci-mtk.c usb: xhci-mtk: fix a short packet issue of gen1 isoc-in transfer 2024-01-04 16:05:50 +01:00
xhci-mtk.h usb: xhci-mtk: fix a short packet issue of gen1 isoc-in transfer 2024-01-04 16:05:50 +01:00
xhci-mvebu.c
xhci-mvebu.h
xhci-pci-renesas.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
xhci-pci.c usb: xhci: Fix problem with xhci resume from suspend 2024-10-04 15:39:17 +02:00
xhci-pci.h xhci-pci: Make xhci-pci-renesas a proper modular driver 2024-08-07 12:51:38 +02:00
xhci-plat.c usb: host: xhci-plat: Parse xhci-missing_cas_quirk and apply quirk 2024-09-11 15:37:52 +02:00
xhci-plat.h usb: xhci-plat: Don't include xhci.h 2024-04-23 16:25:29 -07:00
xhci-port.h XHCI: Separate PORT and CAPs macros into dedicated file 2024-01-27 17:39:09 -08:00
xhci-rcar.c xhci: remove XHCI_TRUST_TX_LENGTH quirk 2024-05-01 08:47:14 +02:00
xhci-ring.c usb: xhci: Fix handling errors mid TD followed by other errors 2024-10-17 08:45:36 +02:00
xhci-rzv2m.c usb: xhci-plat: Don't include xhci.h 2024-04-23 16:25:29 -07:00
xhci-rzv2m.h
xhci-tegra.c xhci: tegra: fix checked USB2 port number 2024-10-16 10:25:43 +02:00
xhci-trace.c
xhci-trace.h xhci: show usb device name in xhci urb tracing 2024-06-27 16:08:05 +02:00
xhci.c xhci: support setting interrupt moderation IMOD for secondary interrupters 2024-09-05 16:39:23 +02:00
xhci.h xhci: Fix incorrect stream context type macro 2024-10-17 08:45:36 +02:00