aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-5.15/950-0747-usb-xhci-rework-XHCI_VLI_SS_BULK_OUT_BUG-quirk.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/bcm27xx/patches-5.15/950-0747-usb-xhci-rework-XHCI_VLI_SS_BULK_OUT_BUG-quirk.patch')
-rw-r--r--target/linux/bcm27xx/patches-5.15/950-0747-usb-xhci-rework-XHCI_VLI_SS_BULK_OUT_BUG-quirk.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-5.15/950-0747-usb-xhci-rework-XHCI_VLI_SS_BULK_OUT_BUG-quirk.patch b/target/linux/bcm27xx/patches-5.15/950-0747-usb-xhci-rework-XHCI_VLI_SS_BULK_OUT_BUG-quirk.patch
new file mode 100644
index 0000000000..273a769ff9
--- /dev/null
+++ b/target/linux/bcm27xx/patches-5.15/950-0747-usb-xhci-rework-XHCI_VLI_SS_BULK_OUT_BUG-quirk.patch
@@ -0,0 +1,51 @@
+From 2b76a32609d4621151beb78354ae945df37e2a1d Mon Sep 17 00:00:00 2001
+From: Jonathan Bell <jonathan@raspberrypi.com>
+Date: Tue, 1 Mar 2022 15:12:15 +0000
+Subject: [PATCH] usb: xhci: rework XHCI_VLI_SS_BULK_OUT_BUG quirk
+
+Fix incorrectly applying the quirk for bulk IN endpoints and remove the
+commentary which is not completely accurate based on observed behaviour.
+
+Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
+---
+ drivers/usb/host/xhci-ring.c | 15 +++++----------
+ 1 file changed, 5 insertions(+), 10 deletions(-)
+
+--- a/drivers/usb/host/xhci-ring.c
++++ b/drivers/usb/host/xhci-ring.c
+@@ -3608,7 +3608,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
+ unsigned int num_trbs;
+ unsigned int start_cycle, num_sgs = 0;
+ unsigned int enqd_len, block_len, trb_buff_len, full_len;
+- int sent_len, ret, vli_quirk = 0;
++ int sent_len, ret, vli_bulk_quirk = 0;
+ u32 field, length_field, remainder, maxpacket;
+ u64 addr, send_addr;
+
+@@ -3654,14 +3654,9 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
+ send_addr = addr;
+
+ if (xhci->quirks & XHCI_VLI_SS_BULK_OUT_BUG &&
+- !usb_urb_dir_in(urb) && urb->dev->speed >= USB_SPEED_SUPER) {
+- /*
+- * VL805 - superspeed bulk OUT traffic can cause
+- * an internal fifo overflow if the TRB buffer is larger
+- * than wMaxPacket and the length is not an integer
+- * multiple of wMaxPacket.
+- */
+- vli_quirk = 1;
++ usb_endpoint_is_bulk_out(&urb->ep->desc)
++ && urb->dev->speed >= USB_SPEED_SUPER) {
++ vli_bulk_quirk = 1;
+ }
+
+ /* Queue the TRBs, even if they are zero-length */
+@@ -3676,7 +3671,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
+ if (enqd_len + trb_buff_len > full_len)
+ trb_buff_len = full_len - enqd_len;
+
+- if (vli_quirk && trb_buff_len > maxpacket) {
++ if (vli_bulk_quirk && trb_buff_len > maxpacket) {
+ /* SS bulk wMaxPacket is 1024B */
+ remainder = trb_buff_len & (maxpacket - 1);
+ trb_buff_len -= remainder;