30c9ae5ece
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> |
||
---|---|---|
.. | ||
bcma-hcd.c | ||
ehci-atmel.c | ||
ehci-brcm.c | ||
ehci-dbg.c | ||
ehci-exynos.c | ||
ehci-fsl.c | ||
ehci-fsl.h | ||
ehci-grlib.c | ||
ehci-hcd.c | ||
ehci-hub.c | ||
ehci-mem.c | ||
ehci-mv.c | ||
ehci-npcm7xx.c | ||
ehci-omap.c | ||
ehci-orion.c | ||
ehci-pci.c | ||
ehci-platform.c | ||
ehci-ppc-of.c | ||
ehci-ps3.c | ||
ehci-q.c | ||
ehci-sched.c | ||
ehci-sh.c | ||
ehci-spear.c | ||
ehci-st.c | ||
ehci-sysfs.c | ||
ehci-timer.c | ||
ehci-xilinx-of.c | ||
ehci.h | ||
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 | ||
isp116x-hcd.c | ||
isp116x.h | ||
isp1362-hcd.c | ||
isp1362.h | ||
Kconfig | ||
Makefile | ||
max3421-hcd.c | ||
octeon-hcd.c | ||
octeon-hcd.h | ||
ohci-at91.c | ||
ohci-da8xx.c | ||
ohci-dbg.c | ||
ohci-exynos.c | ||
ohci-hcd.c | ||
ohci-hub.c | ||
ohci-mem.c | ||
ohci-nxp.c | ||
ohci-omap.c | ||
ohci-pci.c | ||
ohci-platform.c | ||
ohci-ppc-of.c | ||
ohci-ps3.c | ||
ohci-pxa27x.c | ||
ohci-q.c | ||
ohci-s3c2410.c | ||
ohci-sa1111.c | ||
ohci-sm501.c | ||
ohci-spear.c | ||
ohci-st.c | ||
ohci.h | ||
oxu210hp-hcd.c | ||
pci-quirks.c | ||
pci-quirks.h | ||
r8a66597-hcd.c | ||
r8a66597.h | ||
sl811_cs.c | ||
sl811-hcd.c | ||
sl811.h | ||
ssb-hcd.c | ||
uhci-debug.c | ||
uhci-grlib.c | ||
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-dbg.c | ||
xhci-dbgcap.c | ||
xhci-dbgcap.h | ||
xhci-dbgtty.c | ||
xhci-debugfs.c | ||
xhci-debugfs.h | ||
xhci-ext-caps.c | ||
xhci-ext-caps.h | ||
xhci-histb.c | ||
xhci-hub.c | ||
xhci-mem.c | ||
xhci-mtk-sch.c | ||
xhci-mtk.c | ||
xhci-mtk.h | ||
xhci-mvebu.c | ||
xhci-mvebu.h | ||
xhci-pci-renesas.c | ||
xhci-pci.c | ||
xhci-pci.h | ||
xhci-plat.c | ||
xhci-plat.h | ||
xhci-port.h | ||
xhci-rcar.c | ||
xhci-ring.c | ||
xhci-rzv2m.c | ||
xhci-rzv2m.h | ||
xhci-tegra.c | ||
xhci-trace.c | ||
xhci-trace.h | ||
xhci.c | ||
xhci.h |