ACK: [SRU][N][PATCH 0/3] Fix ASPM quirks execution timing by caching link states and adding pcie_aspm_remove_cap
Andrei Gherzan
andrei.gherzan at canonical.com
Thu Sep 10 10:20:41 UTC 2026
On 26/09/08 03:21PM, AceLan Kao via kernel-team wrote:
> From: "Chia-Lin Kao (AceLan)" <acelan.kao at canonical.com>
>
> BugLink: https://bugs.launchpad.net/bugs/2166737
>
> [Impact]
> In Launchpad bug #2132119, commit cc727f2d9a93 ("PCI/ASPM: Avoid L0s for
> Realtek RTS525A") was cherry-picked to 6.8 kernel to stop an AER
> Correctable Replay Timer Timeout storm on HP systems with Realtek RTS525A
> (10ec:525a).
>
> However, that fix registered quirk_disable_aspm_l0s as a
> DECLARE_PCI_FIXUP_HEADER quirk, while in the 6.8 kernel
> quirk_disable_aspm_l0s() still used the old pci_disable_link_state(),
> designed for DECLARE_PCI_FIXUP_FINAL. Because pci_disable_link_state()
> depends on link state structures that are not yet initialized during the
> early HEADER fixup phase, the quirk cannot function as intended.
>
> To make the RTS525A fix and other ASPM quirks work before ASPM
> initialization, the kernel needs the upstream infrastructure that caches
> advertised link states and uses pcie_aspm_remove_cap() during the HEADER
> fixup phase. Without these prerequisites, systems with the RTS525A card
> reader still hit the AER storm and freeze during shutdown or reboot:
>
> pcieport 0000:00:1c.0: AER: Correctable error message received from 0000:58:00.0
> rtsx_pci 0000:58:00.0: PCIe Bus Error: severity=Correctable, type=Data Link Layer, (Transmitter ID)
> rtsx_pci 0000:58:00.0: device [10ec:525a] error status/mask=00001000/00006000
> rtsx_pci 0000:58:00.0: [12] Timeout
>
> [Fix]
> Backport the 3 upstream prerequisite commits from v6.18:
>
> 1. 4495bffd86ba0 ("PCI/ASPM: Cache L0s/L1 Supported so advertised link states can be overridden")
> Cache the L0s Supported and L1 Supported bits early in device enumeration
> so HEADER quirks can override them before pcie_aspm_cap_init() runs.
>
> 2. 575b98e39d817 ("PCI/ASPM: Add pcie_aspm_remove_cap() to override advertised link states")
> Introduce pcie_aspm_remove_cap() to allow quirks to clear advertised
> ASPM L0s or L1 capabilities.
>
> 3. 30579eebba6ae ("PCI/ASPM: Convert quirks to override advertised link states")
> Convert existing ASPM quirks (including quirk_disable_aspm_l0s) to call
> pcie_aspm_remove_cap() and run as HEADER quirks so ASPM is never enabled
> on defective hardware.
>
> [Test Plan]
> On affected HP hardware with Realtek RTS525A (10ec:525a):
>
> 1. Check dmesg for AER storm:
> $ sudo dmesg | grep -i "AER\|rtsx_pci"
>
> Without patches: The kernel AER handler gets flooded with Replay Timer Timeout errors from 10ec:525a.
> With patches: No AER timeout messages appear for the device.
>
> 2. Verify reboot and shutdown:
> $ sudo reboot
> $ sudo poweroff
>
> Without patches: System freezes at shutdown/reboot screen; power LED stays on.
> With patches: Shutdown and reboot complete cleanly.
>
> [Where problems could occur]
> Could affect PCIe device enumeration and ASPM power saving states across
> all PCIe devices.
>
> These commits change the ASPM capability initialization flow and convert
> existing quirks for Intel NICs and ASMedia bridges from FINAL quirks to
> HEADER quirks. If pcie_aspm_remove_cap() or link state caching has a flaw,
> supported ASPM states on PCIe devices could be incorrectly cleared or
> retained. If ASPM is accidentally disabled on non-target devices, system
> idle power consumption on battery would increase. If disabled states fail
> to clear, affected devices could experience bus errors or link dropouts.
>
> [Other Info]
> Follow-up to LP: #2132119. All 3 prerequisite commits are upstream in v6.18.
> This SRU targets noble (linux 6.8).
>
> Bjorn Helgaas (3):
> PCI/ASPM: Cache L0s/L1 Supported so advertised link states can be
> overridden
> PCI/ASPM: Add pcie_aspm_remove_cap() to override advertised link
> states
> PCI/ASPM: Convert quirks to override advertised link states
>
> drivers/pci/pci.h | 2 ++
> drivers/pci/pcie/aspm.c | 25 +++++++++++++++++--------
> drivers/pci/probe.c | 7 +++++++
> drivers/pci/quirks.c | 39 +++++++++++++++++++--------------------
> include/linux/pci.h | 2 ++
> 5 files changed, 47 insertions(+), 28 deletions(-)
Acked-by: Andrei Gherzan <andrei.gherzan at canonical.com>
--
Andrei Gherzan
gpg: rsa4096/D4D94F67AD0E9640
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20260910/2bf20a5d/attachment.sig>
More information about the kernel-team
mailing list