0
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2025-09-17 05:49:23 +00:00
Files
openwrt/target/linux/bcm27xx/patches-6.12/950-0950-usb-xhci-default-to-Intel-scheme-for-calculating-U1-.patch
John Audia b92bab633f kernel: bump 6.12 to 6.12.44
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.44

Removed upstreamed:
  generic-backport/220-v6.16-powerpc-boot-fix-build-with-gcc-15.patch[1]
  imx/patches-6.12/506-pending-PCI-imx6-Remove-apps_reset-toggle-in-_core_reset-function.patch[2]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.44&id=e42ac65e257b875614dd8f435b026a3e379e92e6
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.44&id=90fa5884bc8f52cbf493492e32978c723c85e6ab

Build system: x86/64 (Intel N150 based)
Build-tested: flogic/gl.inet-gl-mt6000, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3, x86/64-glibc
Run-tested: flogic/gl.inet-gl-mt6000, 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/19892
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-31 13:07:49 +02:00

61 lines
2.3 KiB
Diff

From fbadc723477d9cfe1d7c758bd1465d0e455565f0 Mon Sep 17 00:00:00 2001
From: Jonathan Bell <jonathan@raspberrypi.com>
Date: Tue, 15 Apr 2025 14:44:07 +0100
Subject: [PATCH] usb: xhci: default to Intel scheme for calculating U1/U2
timeouts
By default, the System Exit Latency and Maximum Exit Latency are used to
calculate hub port U1 and U2 timeout values. This has the effect of
aggressively power-managing a SuperSpeed link but devices are known to
report unfeasibly short device exit latencies in their descriptors,
which under certain usage conditions can significantly degrade
throughput as the link spends longer retraining than being in a useable
state.
The Intel heuristic approach calculates a reasonably large
endpoint-dependent U1 timeout, and uses a minimum U2 timeout that is
several multiples of typical U2 exit latencies.
Add a module parameter that defaults to using this scheme.
This should have the effect of squelching interop edge-cases where LPM
noticeably degrades performance, and avoid the usual workaround where
userspace manually disables it.
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
---
drivers/usb/host/xhci.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -39,6 +39,10 @@ static unsigned long long quirks;
module_param(quirks, ullong, S_IRUGO);
MODULE_PARM_DESC(quirks, "Bit flags for quirks to be enabled as default");
+static int sandbag_lpm = 1;
+module_param(sandbag_lpm, int, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(sandbag_lpm, "Use relaxed U1/U2 port LPM timeouts");
+
static bool td_on_ring(struct xhci_td *td, struct xhci_ring *ring)
{
struct xhci_segment *seg = ring->first_seg;
@@ -4795,7 +4799,7 @@ static u16 xhci_calculate_u1_timeout(str
}
}
- if (xhci->quirks & (XHCI_INTEL_HOST | XHCI_ZHAOXIN_HOST))
+ if (sandbag_lpm || xhci->quirks & (XHCI_INTEL_HOST | XHCI_ZHAOXIN_HOST))
timeout_ns = xhci_calculate_intel_u1_timeout(udev, desc);
else
timeout_ns = udev->u1_params.sel;
@@ -4859,7 +4863,7 @@ static u16 xhci_calculate_u2_timeout(str
}
}
- if (xhci->quirks & (XHCI_INTEL_HOST | XHCI_ZHAOXIN_HOST))
+ if (sandbag_lpm || xhci->quirks & (XHCI_INTEL_HOST | XHCI_ZHAOXIN_HOST))
timeout_ns = xhci_calculate_intel_u2_timeout(udev, desc);
else
timeout_ns = udev->u2_params.sel;