immortalwrt-VIKINGYFY/target/linux/bcm27xx/patches-6.12/950-0949-PCI-quirks-work-around-VL805-firmware-ASPM-meddling.patch
gongzi miao 738876e76b kernel: bump 6.12 to 6.12.58
changelogs:
https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.58

Removed upstreamed patches:
1. target/linux/generic/backport-6.12/612-01-v6.17-net-dsa-tag_brcm-legacy-reorganize-functions.patch
   Upstream: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.58&id=a4daaf063f8269a5881154c5b77c5ef6639d65d3

2. target/linux/qualcommax/patches-6.12/0151-arm64-qcom-ipq6018-nss_port5.patch
   Upstream: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.58&id=9a7a5d50ee2e035325de9c720e4842d6759d2374

3. target/linux/realtek/patches-6.12/020-01-v6.18-timer-rtl-otto-work-around-dying-timers.patch
   Upstream: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.58&id=d0e217b33d42bfe52ef7ef447916a23a586e6e5c

4. target/linux/realtek/patches-6.12/020-03-v6.18-timer-rtl-otto-do-not-interfere-with-interrupts.patch
   Upstream: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.58&id=8cc561dd9d02f1753ae34dfdd565662828be9a9d

Additional changes:
- Manually adapted bcm27xx patch:
  * 950-0410-media-i2c-adv7180-Add-support-for-V4L2_CID_LINK_FREQ.patch
    Rebased and adjusted for kernel 6.12 to fix context conflicts.
- Synced lantiq DTS (danube.dtsi) with upstream bindings
  to fix DT validation issues on kernel 6.12.
- Manually adapted DTS to match OpenWrt's lantiq DTS layout.

Compile-tested on x86_64
Run-tested on x86_64

Signed-off-by: gongzi miao <miaogongzi0227@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20777
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-20 21:30:26 +01:00

44 lines
1.7 KiB
Diff

From 1af55c553f3b793667e8adf834e1e59deb23d8c0 Mon Sep 17 00:00:00 2001
From: Jonathan Bell <jonathan@raspberrypi.com>
Date: Tue, 15 Apr 2025 14:19:31 +0100
Subject: [PATCH] PCI: quirks: work around VL805 firmware ASPM meddling
Certain versions of the VL805 firmware manipulate the endpoint Link
Control register to toggle ASPM on/off based on workload, but these
versions also report 0 in the Device Capability Acceptable Latency field
leaving the RC with ASPM disabled.
As it turns out, this EP has a broken L0s implementation so a) override
L1 latency to a sensible value and b) mask L0s.
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
---
drivers/pci/quirks.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -6256,6 +6256,22 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x56b1, aspm_l1_acceptable_latency);
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x56c0, aspm_l1_acceptable_latency);
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x56c1, aspm_l1_acceptable_latency);
+
+/*
+ * VL805 firmware can report 0 in the L0s/L1 Acceptable Latency fields.
+ * This is shorter than its own exit latency so ASPM for the link partner
+ * never gets enabled (but firmware toggles EP L1/L0s enable internally).
+ * However, L0s is flaky so explicitly disable it.
+ */
+static void vl805_aspm_fixup(struct pci_dev *dev)
+{
+ dev->devcap &= ~PCI_EXP_DEVCAP_L1;
+ /* Set to own exit latency + 1 */
+ dev->devcap |= FIELD_PREP(PCI_EXP_DEVCAP_L1, 5);
+ pci_disable_link_state(dev, PCIE_LINK_STATE_L0S);
+ pci_info(dev, "ASPM: VL805 fixup applied\n");
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, 0x3483, vl805_aspm_fixup);
#endif
#ifdef CONFIG_PCIE_DPC