0
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2025-09-15 08:10:09 +00:00
Files
openwrt/target/linux/bcm27xx/patches-6.12/950-0334-usb-xhci-add-VLI_SS_BULK_OUT_BUG-quirk.patch
John Audia f39c7e103f kernel: bump 6.12 to 6.12.43
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.43

Removed upstreamed:
    generic/backport-6.12/612-07-v6.17-net-dsa-b53-prevent-SWITCH_CTRL-access-on-BCM5325.patch[1]
    generic-backport/612-08-v6.17-net-dsa-b53-fix-IP_MULTICAST_CTRL-on-BCM5325.patch[2]
    generic-backport/612-09-v6.17-net-dsa-b53-prevent-DIS_LEARNING-access-on-BCM5325.patch[3]
    generic-backport/612-11-v6.17-net-dsa-b53-prevent-GMII_PORT_OVERRIDE_CTRL-access-on-BCM5325.patch[4]
    generic-backport/612-14-v6.17-net-dsa-b53-ensure-BCM5325-PHYs-are-enabled.patch[5]
    generic-backport/830-v6.17-Revert-leds-trigger-netdev-Configure-LED-blink-inter.patch[6]
    bcm27xx/patches-6.12/950-0100-media-tc358743-Increase-FIFO-level-to-374.patch[7]
    bcm27xx/patches-6.12/950-0102-media-tc358743-Check-I2C-succeeded-during-probe.patch[8]
    bcm27xx/patches-6.12/950-0107-media-tc358743-Return-an-appropriate-colorspace-from.patch[9]
    bcm27xx/patches-6.12/950-0341-Allow-RESET_BRCMSTB-on-ARCH_BCM2835.patch[10]
    lantiq/patches-6.12/102-11-v6.17-MIPS-lantiq-falcon-sysctrl-fix-request-memory-check-.patch[11]
    lantiq/patches-6.12/102-12-v6.17-MIPS-vpe-mt-add-missing-prototypes-for-vpe_-alloc-st.patch[12]
    qualcommax/patches-6.12/0170-clk-qcom-gcc-ipq8074-fix-broken-freq-table-for-nss_port6_tx_clk_src.patch[13]
    generic/backport-6.12/612-13-v6.17-net-dsa-b53-fix-b53_imp_vlan_setup-for-BCM5325.patch[14]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.43&id=f16f96ccfe56ef2d627c20ba47f6d9d7dea40f5b
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.43&id=394bd12d1f93ed2fa0fa1d8f31ffd3c344681e85
3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.43&id=9f45e4858f8096bb27f9a2c75fc24a538dffad67
4. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.43&id=15cf46cc6ecc7a54b397294675d11c379ddf69ef
5. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.43&id=0d250ad617a035904744cef74a5d5dc43d0199b9
6. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.43&id=cb9bb872366e10fa42e1e0200a0c2e5d05a27bec
7. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.43&id=f25d566c5674decd0051a3e624805fc1524729bf
8. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.43&id=3e03ee3b65baeac4c253b30650492ffffad9b608
9. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.43&id=b42b107293b52ac8d46238815b1071138a47a7e4
10. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.43&id=e285cdb9d2e4ba2e4515ae898f92e9f38be64eb3
11. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.43&id=1e9079ff83eac962bc3b1e2fbad73b2f7d5256f4
12. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.43&id=8520c843d9a2770012f23da08e4e2ccf1bb05ba6
13. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.43&id=f1c5c55fb6cda312f5ed15505588caaf05a69043
14. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.43&id=757955c80663ac3df7053abaf6fcc75051ef7a7c

Build system: x86/64 (Intel N150 based)
Build-tested: flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3, x86/64-glibc
Run-tested: flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3, x86/64-glibc

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/19618
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-08-26 21:35:36 +02:00

111 lines
3.9 KiB
Diff

From 008cf2e98f40f24db4ce9f6c06dc0ab0be67b08e Mon Sep 17 00:00:00 2001
From: Jonathan Bell <jonathan@raspberrypi.com>
Date: Thu, 8 Sep 2022 15:50:15 +0100
Subject: [PATCH] usb: xhci: add VLI_SS_BULK_OUT_BUG quirk
The VL805 can cause data corruption if a SS Bulk OUT endpoint enters a
flow-control condition and there are TRBs in the transfer ring that are
not an integral size of wMaxPacket and the endpoint is behind one or more
hubs.
This is frequently the case encountered when FAT32 filesystems are
present on mass-storage devices with cluster sizes of 1 sector, and the
filesystem is being written to with an aggregate of small files.
The initial implementation of this quirk separated TRBs that didn't
adhere to this limitation into two - the first a multiple of wMaxPacket
and the second the 512-byte remainder - in an attempt to force TD
fragments to align with packet boundaries. This reduced the incidence
rate of data corruption but did not resolve it.
The fix as recommended by VIA is to disable bursts if this sequence of
TRBs can occur.
Limit turning off bursts to just USB mass-storage devices by searching
the device's configuration for an interface with a class type of
USB_CLASS_MASS_STORAGE.
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
---
drivers/usb/host/xhci-mem.c | 31 ++++++++++++++++++++++++++++++-
drivers/usb/host/xhci-pci.c | 1 +
drivers/usb/host/xhci.h | 1 +
3 files changed, 32 insertions(+), 1 deletion(-)
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -1397,6 +1397,7 @@ int xhci_endpoint_init(struct xhci_hcd *
unsigned int ep_index;
struct xhci_ep_ctx *ep_ctx;
struct xhci_ring *ep_ring;
+ struct usb_interface_cache *intfc;
unsigned int max_packet;
enum xhci_ring_type ring_type;
u32 max_esit_payload;
@@ -1406,6 +1407,8 @@ int xhci_endpoint_init(struct xhci_hcd *
unsigned int mult;
unsigned int avg_trb_len;
unsigned int err_count = 0;
+ unsigned int is_ums_dev = 0;
+ unsigned int i;
ep_index = xhci_get_endpoint_index(&ep->desc);
ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index);
@@ -1441,9 +1444,35 @@ int xhci_endpoint_init(struct xhci_hcd *
mult = xhci_get_endpoint_mult(udev, ep);
max_packet = usb_endpoint_maxp(&ep->desc);
- max_burst = xhci_get_endpoint_max_burst(udev, ep);
avg_trb_len = max_esit_payload;
+ /*
+ * VL805 errata - Bulk OUT bursts to superspeed mass-storage
+ * devices behind hub ports can cause data corruption with
+ * non-wMaxPacket-multiple transfers.
+ */
+ for (i = 0; i < udev->config->desc.bNumInterfaces; i++) {
+ intfc = udev->config->intf_cache[i];
+ /*
+ * Slight hack - look at interface altsetting 0, which
+ * should be the UMS bulk-only interface. If the class
+ * matches, then we disable out bursts for all OUT
+ * endpoints because endpoint assignments may change
+ * between alternate settings.
+ */
+ if (intfc->altsetting[0].desc.bInterfaceClass ==
+ USB_CLASS_MASS_STORAGE) {
+ is_ums_dev = 1;
+ break;
+ }
+ }
+ if (xhci->quirks & XHCI_VLI_SS_BULK_OUT_BUG &&
+ usb_endpoint_is_bulk_out(&ep->desc) && is_ums_dev &&
+ udev->route)
+ max_burst = 0;
+ else
+ max_burst = xhci_get_endpoint_max_burst(udev, ep);
+
/* FIXME dig Mult and streams info out of ep companion desc */
/* Allow 3 retries for everything but isoc, set CErr = 3 */
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -456,6 +456,7 @@ static void xhci_pci_quirks(struct devic
xhci->quirks |= XHCI_TRB_OVERFETCH;
xhci->quirks |= XHCI_EP_CTX_BROKEN_DCS;
xhci->quirks |= XHCI_AVOID_DQ_ON_LINK;
+ xhci->quirks |= XHCI_VLI_SS_BULK_OUT_BUG;
}
if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1630,6 +1630,7 @@ struct xhci_hcd {
/* Downstream VLI fixes */
#define XHCI_AVOID_DQ_ON_LINK BIT_ULL(56)
+#define XHCI_VLI_SS_BULK_OUT_BUG BIT_ULL(57)
unsigned int num_active_eps;
unsigned int limit_active_eps;