mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Max Lee <max.lee@canonical.com>
To: Lukas Wunner <lukas@wunner.de>
Cc: bhelgaas@google.com, Manivannan Sadhasivam <mani@kernel.org>,
	 Bjorn Helgaas <helgaas@kernel.org>,
	linux-pci@vger.kernel.org,  linux-kernel@vger.kernel.org,
	acelan.kao@canonical.com,  Kai-Heng Feng <kaihengf@nvidia.com>,
	Victor Shih <victorshihgli@gmail.com>,
	 Jon Pan-Doh <pandoh@google.com>
Subject: Re: [PATCH v2] PCI: Mask Replay Timer Timeout for Realtek RTS525A
Date: Mon, 6 Jul 2026 10:34:04 +0800	[thread overview]
Message-ID: <CA+YcyLw0HpR1Dnz-mOL1Ryym89ytc=1a_Ri9buMt3at-9mib+g@mail.gmail.com> (raw)
In-Reply-To: <akZ448o-YMGfEEOP@wunner.de>

On Thu, Jul 02, 2026 at 04:42:43PM +0200, Lukas Wunner wrote:
> There were Advisory Non-Fatal Errors on both ends of the links.
> The upstream kernel does not support ANFE so far, but this
> development branch contains three tentative patches to add it:
>
> https://github.com/l1k/linux/commits/anfe_v1/
>
> So far this is compile-tested only. You may want to give these
> patches a spin to see which Non-Fatal Errors are signaled. The
> kernel should also dump the TLP Prefix Log for those errors and
> you can use this tool to decode it:
>
> https://github.com/mmpg-x86/tlp-tool
>
> See the example usage in: Documentation/PCI/pcieaer-howto.rst
>
> The TLP Prefix Log might give a hint as to the root cause.
>
> [...]
>
> Bjorn mentioned commit eeee3b5e6d0b, which states that the Replay Timer
> Timeout errors (only) occur when ASPM is enabled. That may be the
> actual root cause, so you may want to play with ASPM settings (disable
> L1 substates etc) to see if it makes the issue go away. Disabling
> non-working ASPM settings in a quirk would be better than silencing
> the ensuing errors.

Thanks Lukas for the suggestions

I tested Lukas' anfe_v1 branch on the affected system:

https://github.com/l1k/linux.git anfe_v1
ca3701e1b037 ("PCI/AER: Support Advisory Non-Fatal Errors")

The tested kernel was:

Linux localhost 7.2.0-rc1+ #2 SMP PREEMPT_DYNAMIC Fri Jul 3 08:00:24 UTC 2026

With that kernel, the storm still reproduced, but the reported error
remained a Correctable Replay Timer Timeout. I did not see Advisory
Non-Fatal Error or TLP Prefix/Header Log output for this storm.

The relevant dmesg lines were still:

pcieport 0000:00:1c.6: AER: Correctable error message received from 0000:58:00.0
pci 0000:58:00.0: PCIe Bus Error: severity=Correctable
pci 0000:58:00.0: device [10ec:525a] error status/mask=00001000/00004000
pci 0000:58:00.0: [12] Timeout | Transmitter | Data Link Layer

In that boot, dmesg contained 767 printed Correctable/Timeout messages
and 76 aer_ratelimit lines. The actual interrupt/counter volume was much
higher. Before stopping the storm, /proc/interrupts showed:

IR-PCI-MSI-0000:00:1c.6 ... 37981589 ... PCIe PME, aerdrv, PCIe bwctrl

The AER sysfs counters showed:

Endpoint 0000:58:00.0:
Timeout 12018352
TOTAL_ERR_COR 12018352
TOTAL_ERR_FATAL 0
TOTAL_ERR_NONFATAL 0

Root Port 0000:00:1c.6:
aer_rootport_total_err_cor 12062319
aer_rootport_total_err_fatal 0
aer_rootport_total_err_nonfatal 0

I then tested the ASPM settings directly. With OS-native AER active,
disabling only L0s on the RTS525A link stopped new AER interrupt and
counter growth while leaving L1 enabled:

echo 0 > /sys/bus/pci/devices/0000:58:00.0/link/l0s_aspm

After that, over a 10 second interval:

irq_delta=0
endpoint_cor_delta=0
rootport_cor_delta=0
link_l0s=0
link_l1=1

Disabling L1, L1 substates, or Clock PM alone did not stop the storm.
The storm also did not require the rtsx_pci driver to bind: it was
reproducible while rtsx_pci/rtsx_pci_sdmmc were blacklisted and the
endpoint was not enabled by a driver.

Based on this, I agree that disabling the non-working ASPM state is a
better direction than masking the resulting AER reports.

I tested a v3 patch that disables L0s for the RTS525A by removing L0s
from the device's ASPM link capability:

DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_REALTEK, 0x525a,
quirk_disable_aspm_l0s);

I tested that patch on top of Lukas' anfe_v1 branch. The patched kernel
booted as:

Linux localhost 7.2.0-rc1-rts525a-l0s+ #4 SMP PREEMPT_DYNAMIC Mon Jul
6 02:08:30 UTC 2026

The quirk ran during enumeration:

pci 0000:58:00.0: ASPM: Link Capabilities L0s treated as unsupported
to avoid device defect

With the temporary rtsx_pci blacklist removed and the initramfs rebuilt,
the card reader driver bound normally:

  rtsx_pci 0000:58:00.0: enabling device (0000 -> 0002)

  rtsx_pci_sdmmc         36864  0
  rtsx_pci              143360  1 rtsx_pci_sdmmc

The endpoint was enabled and bound to rtsx_pci:

  0000:58:00.0 enable=1
  0000:58:00.0 power_state=D3hot
  driver=/sys/bus/pci/drivers/rtsx_pci

L0s was no longer enabled, while L1 remained enabled on both ends of the
link:

  0000:00:1c.6:
    LnkCtl: ASPM L1 Enabled

  0000:58:00.0:
    LnkCtl: ASPM L1 Enabled

The endpoint link sysfs state also showed L1 and L1 substates still
enabled:

  clkpm=1
  l1_1_aspm=1
  l1_1_pcipm=1
  l1_2_aspm=1
  l1_2_pcipm=1
  l1_aspm=1

The l0s_aspm sysfs file was no longer present for the endpoint link,
consistent with L0s being removed from the ASPM capability.

After booting the patched kernel with rtsx_pci bound, there were no AER
Correctable Replay Timer Timeout messages and no aer_ratelimit lines in
dmesg:

  aer_correctable=0
  timeout_lines=0
  ratelimit_lines=0

Over a 10 second interval after boot, IRQ and AER counters did not
increase:

  irq_delta=0
  endpoint_cor_delta=0
  rootport_cor_delta=0

The counters stayed at zero:

  Endpoint 0000:58:00.0:
    Timeout 0
    TOTAL_ERR_COR 0

  Root Port 0000:00:1c.6:
    aer_rootport_total_err_cor 0

So for this system, the evidence points specifically at L0s on the
RTS525A link: enabling L0s triggers the Correctable Replay Timer Timeout
storm, and disabling L0s stops it while leaving L1 enabled.

I will send v3 changing the quirk from masking AER Replay Timer Timeout
to disabling ASPM L0s for the RTS525A.

Thanks,
Max

  reply	other threads:[~2026-07-06  2:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-28  3:23 [PATCH] " Max Lee
2026-06-10  2:47 ` [PATCH v2] " Max Lee
2026-07-01  6:27   ` Manivannan Sadhasivam
2026-07-01 20:42     ` Bjorn Helgaas
2026-07-02  5:10       ` Lukas Wunner
2026-07-02  7:06         ` Max Lee
2026-07-02 14:42           ` Lukas Wunner
2026-07-06  2:34             ` Max Lee [this message]
2026-07-02  8:08       ` Manivannan Sadhasivam
2026-07-06  2:53   ` [PATCH v3] PCI: Disable ASPM L0s " Max Lee
2026-07-06  9:41     ` Lukas Wunner
2026-07-06 10:20     ` Manivannan Sadhasivam
2026-07-07  2:15   ` [PATCH v4] " Max Lee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+YcyLw0HpR1Dnz-mOL1Ryym89ytc=1a_Ri9buMt3at-9mib+g@mail.gmail.com' \
    --to=max.lee@canonical.com \
    --cc=acelan.kao@canonical.com \
    --cc=bhelgaas@google.com \
    --cc=helgaas@kernel.org \
    --cc=kaihengf@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=mani@kernel.org \
    --cc=pandoh@google.com \
    --cc=victorshihgli@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox