usb: xhci: expand the scope of XHCI_VLI_SS_BULK_OUT_BUG
authorJonathan Bell <jonathan@raspberrypi.com>
Tue, 1 Mar 2022 15:17:04 +0000 (15:17 +0000)
committerDom Cobley <popcornmix@gmail.com>
Mon, 21 Mar 2022 16:04:45 +0000 (16:04 +0000)
commit40686d87f87a46b3abf48a8dcaee5e0a031deafb
tree2e218a156d65544e44202940b6a1b457126bd3eb
parent3066be08b0174101a684e87b3905a941e37fa012
usb: xhci: expand the scope of XHCI_VLI_SS_BULK_OUT_BUG

Further testing has revealed that any TRB with buffer length that is not
a multiple of wMaxPacket and not the last TRB in a TD can cause data
corruption.

Work around this by linearising any vulnerable Bulk OUT scatter-gather
URBs prior to URB submission. Normal XHCI TRB formation will split
buffers on 64K boundaries and align TRBs prior to a Link TRB to
wMaxPacket, so keep the residue TRB generation added with the first
iteration of the quirk which will guarantee the last TRB is the only TRB
with an odd buffer size.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
drivers/usb/host/xhci.c