* [PATCH v3 1/2] x86/PCI: Work around AMD erratum #1146 on Family 17h root ports
[not found] <20261203145647.707695-1-anthony.pighin@nokia.com>
@ 2026-12-03 14:56 ` Anthony Pighin
2026-12-04 16:02 ` Yazen Ghannam
2026-12-05 23:21 ` Bjorn Helgaas
0 siblings, 2 replies; 4+ messages in thread
From: Anthony Pighin @ 2026-12-03 14:56 UTC (permalink / raw)
To: Bjorn Helgaas, linux-pci
Cc: x86, linux-kernel, Mario Limonciello, Yazen Ghannam, David Laight,
stable
AMD Family 17h Models 00h-0Fh processors are affected by erratum #1146,
"PCIe DPC RP PIO Error Reporting May Not Function Correctly". The RP PIO
SysError register in the DPC Extended Capability has inverted enable
bits, so its zero reset value enables System Error reporting of RP PIO
errors on every root port, and the processor may mishandle such a System
Error. No fix is planned. The documented workaround is to program bits
[18:0] of the register to 0x7_0707.
With the register at zero, a config read to a root port whose link is
down (e.g. after Link Disable or during an endpoint reset) completes
with an RP PIO error that is escalated even when all RP PIO errors are
masked. When that coincides with MMIO to an endpoint behind another root
port of the same PCIe controller, the system takes a data fabric sync
flood and resets. With the workaround, the same reads return all-ones
and are logged by AER as Advisory Non-Fatal errors.
Apply the workaround to affected root ports that implement the DPC RP
Extensions, at enumeration and on resume, since the DPC state saved
across suspend does not include this register.
Link: https://docs.amd.com/v/u/en-US/55449-PUB-1.21
Cc: stable@vger.kernel.org
Signed-off-by: Anthony Pighin <anthony.pighin@nokia.com>
---
arch/x86/pci/fixup.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
index 795d81c7a4de..d8ea0e5292ae 100644
--- a/arch/x86/pci/fixup.c
+++ b/arch/x86/pci/fixup.c
@@ -1180,3 +1180,27 @@ static void quirk_tuxeo_rp_d3(struct pci_dev *pdev)
}
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x1502, quirk_tuxeo_rp_d3);
#endif /* CONFIG_SUSPEND */
+
+/*
+ * AMD erratum #1146 (Family 17h Models 00h-0Fh Revision Guide 55449). The
+ * DPC RP PIO SysError register has inverted enable bits, so its zero reset
+ * value escalates Root Port PIO errors to a System Error that the processor
+ * may mishandle. Write the documented value to disable the escalation.
+ */
+static void quirk_amd_dpc_rp_pio_syserror(struct pci_dev *dev)
+{
+ u16 dpc, val;
+
+ dpc = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_DPC);
+ if (!dpc)
+ return;
+
+ pci_read_config_word(dev, dpc + PCI_EXP_DPC_CAP, &val);
+ if (!(val & PCI_EXP_DPC_CAP_RP_EXT))
+ return;
+
+ pci_write_config_dword(dev, dpc + PCI_EXP_DPC_RP_PIO_SYSERROR, 0x00070707);
+ pci_info(dev, "AMD erratum #1146: disable DPC RP PIO System Error escalation\n");
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1453, quirk_amd_dpc_rp_pio_syserror);
+DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_AMD, 0x1453, quirk_amd_dpc_rp_pio_syserror);
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v3 1/2] x86/PCI: Work around AMD erratum #1146 on Family 17h root ports
2026-12-03 14:56 ` [PATCH v3 1/2] x86/PCI: Work around AMD erratum #1146 on Family 17h root ports Anthony Pighin
@ 2026-12-04 16:02 ` Yazen Ghannam
2026-12-04 16:25 ` Anthony Pighin
2026-12-05 23:21 ` Bjorn Helgaas
1 sibling, 1 reply; 4+ messages in thread
From: Yazen Ghannam @ 2026-12-04 16:02 UTC (permalink / raw)
To: Anthony Pighin
Cc: Bjorn Helgaas, linux-pci, x86, linux-kernel, Mario Limonciello,
David Laight, stable
On Thu, Dec 03, 2026 at 09:56:46AM -0500, Anthony Pighin wrote:
> AMD Family 17h Models 00h-0Fh processors are affected by erratum #1146,
> "PCIe DPC RP PIO Error Reporting May Not Function Correctly". The RP PIO
> SysError register in the DPC Extended Capability has inverted enable
> bits, so its zero reset value enables System Error reporting of RP PIO
> errors on every root port, and the processor may mishandle such a System
> Error. No fix is planned. The documented workaround is to program bits
> [18:0] of the register to 0x7_0707.
>
> With the register at zero, a config read to a root port whose link is
> down (e.g. after Link Disable or during an endpoint reset) completes
> with an RP PIO error that is escalated even when all RP PIO errors are
> masked. When that coincides with MMIO to an endpoint behind another root
"...even when...masked"
This refers to "RP PIO Mask Register", correct? Can you please share the
value from your system?
I'm trying to reproduce this behavior, and so far the masking prevents
escalation.
So I just want to make sure the commit message is accurate.
> port of the same PCIe controller, the system takes a data fabric sync
> flood and resets. With the workaround, the same reads return all-ones
> and are logged by AER as Advisory Non-Fatal errors.
>
> Apply the workaround to affected root ports that implement the DPC RP
> Extensions, at enumeration and on resume, since the DPC state saved
> across suspend does not include this register.
>
> Link: https://docs.amd.com/v/u/en-US/55449-PUB-1.21
> Cc: stable@vger.kernel.org
> Signed-off-by: Anthony Pighin <anthony.pighin@nokia.com>
> ---
> arch/x86/pci/fixup.c | 24 ++++++++++++++++++++++++
> 1 file changed, 24 insertions(+)
>
> diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
> index 795d81c7a4de..d8ea0e5292ae 100644
> --- a/arch/x86/pci/fixup.c
> +++ b/arch/x86/pci/fixup.c
> @@ -1180,3 +1180,27 @@ static void quirk_tuxeo_rp_d3(struct pci_dev *pdev)
> }
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x1502, quirk_tuxeo_rp_d3);
> #endif /* CONFIG_SUSPEND */
> +
> +/*
> + * AMD erratum #1146 (Family 17h Models 00h-0Fh Revision Guide 55449). The
> + * DPC RP PIO SysError register has inverted enable bits, so its zero reset
> + * value escalates Root Port PIO errors to a System Error that the processor
> + * may mishandle. Write the documented value to disable the escalation.
> + */
Question for the maintainers: should these details be left to the commit
message rather than code comments?
> +static void quirk_amd_dpc_rp_pio_syserror(struct pci_dev *dev)
> +{
> + u16 dpc, val;
> +
> + dpc = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_DPC);
> + if (!dpc)
> + return;
> +
> + pci_read_config_word(dev, dpc + PCI_EXP_DPC_CAP, &val);
> + if (!(val & PCI_EXP_DPC_CAP_RP_EXT))
> + return;
> +
> + pci_write_config_dword(dev, dpc + PCI_EXP_DPC_RP_PIO_SYSERROR, 0x00070707);
> + pci_info(dev, "AMD erratum #1146: disable DPC RP PIO System Error escalation\n");
> +}
> +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1453, quirk_amd_dpc_rp_pio_syserror);
> +DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_AMD, 0x1453, quirk_amd_dpc_rp_pio_syserror);
> --
Otherwise, looks good to me.
Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com>
Thanks,
Yazen
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3 1/2] x86/PCI: Work around AMD erratum #1146 on Family 17h root ports
2026-12-04 16:02 ` Yazen Ghannam
@ 2026-12-04 16:25 ` Anthony Pighin
0 siblings, 0 replies; 4+ messages in thread
From: Anthony Pighin @ 2026-12-04 16:25 UTC (permalink / raw)
To: Yazen Ghannam
Cc: Bjorn Helgaas, linux-pci, x86, linux-kernel, Mario Limonciello,
Mario Limonciello, David Laight, stable
On Fri, Dec 04, 2026 at 11:02:04AM -0500, Yazen Ghannam wrote:
> On Thu, Dec 03, 2026 at 09:56:46AM -0500, Anthony Pighin wrote:
> > With the register at zero, a config read to a root port whose link is
> > down (e.g. after Link Disable or during an endpoint reset) completes
> > with an RP PIO error that is escalated even when all RP PIO errors are
> > masked. When that coincides with MMIO to an endpoint behind another root
>
> "...even when...masked"
>
> This refers to "RP PIO Mask Register", correct? Can you please share the
> value from your system?
>
> I'm trying to reproduce this behavior, and so far the masking prevents
> escalation.
>
> So I just want to make sure the commit message is accurate.
Yes. On my system, firmware leaves the RP PIO Mask at 0x00070707 and
Severity at 0 on all root ports, and the kernel does not write them.
With the mask unchanged, the reproducer survived 120 seconds with
SysError at 0x00070707. Setting SysError back to 0 at runtime gave a
sync flood within seconds (IOHC SYNCFLOOD_STATUS 0x100).
The trigger is narrow, which may be why you don't see it. Config reads
(about 20 per second is enough) to a device behind a root port with Link
Disable set complete with Cfg CTO. They only cause the sync flood while a
tight MMIO read loop runs to an endpoint behind another root port of the
same PCIe controller (an I210 in my case). Config reads alone, slow MMIO,
MMIO to on-die devices, or an endpoint on another controller do not fail.
This first appeared after commit 4d909bf1a53e ("PCI: Refactor extended
capability search into PCI_FIND_NEXT_EXT_CAP()"). Its extended capability
walk no longer skips disconnected devices, so every walk after an
endpoint reset issues hundreds of config reads behind the down link.
The fix for that [1] is still pending. It removes the burst, but not
the underlying exposure that this patch addresses.
You're right that "escalated" is my inference from the sync flood. I
don't observe the System Error itself. If a v4 is needed, I can reword
it to what I observed.
> Question for the maintainers: should these details be left to the commit
> message rather than code comments?
Fine with me to reduce the comment to the erratum reference if Bjorn
prefers.
Anthony
[1] https://lore.kernel.org/r/20261019165159.1268120-1-anthony.pighin@nokia.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3 1/2] x86/PCI: Work around AMD erratum #1146 on Family 17h root ports
2026-12-03 14:56 ` [PATCH v3 1/2] x86/PCI: Work around AMD erratum #1146 on Family 17h root ports Anthony Pighin
2026-12-04 16:02 ` Yazen Ghannam
@ 2026-12-05 23:21 ` Bjorn Helgaas
1 sibling, 0 replies; 4+ messages in thread
From: Bjorn Helgaas @ 2026-12-05 23:21 UTC (permalink / raw)
To: Anthony Pighin
Cc: Bjorn Helgaas, linux-pci, x86, linux-kernel, Mario Limonciello,
Yazen Ghannam, David Laight, stable, Lukas Wunner,
Kuppuswamy Sathyanarayanan
[+cc Lukas, Sathya]
On Thu, Dec 03, 2026 at 09:56:46AM -0500, Anthony Pighin wrote:
> AMD Family 17h Models 00h-0Fh processors are affected by erratum #1146,
> "PCIe DPC RP PIO Error Reporting May Not Function Correctly". The RP PIO
> SysError register in the DPC Extended Capability has inverted enable
> bits, so its zero reset value enables System Error reporting of RP PIO
> errors on every root port, and the processor may mishandle such a System
> Error.
By "processor may mishandle", I guess you mean Linux doesn't have the
code required to recover from it? Or is there another erratum in how
the CPU itself executes whatever the SysError causes?
> No fix is planned. The documented workaround is to program bits
> [18:0] of the register to 0x7_0707.
>
> With the register at zero, a config read to a root port whose link is
> down (e.g. after Link Disable or during an endpoint reset) completes
> with an RP PIO error that is escalated even when all RP PIO errors are
> masked.
I guess this config read would be to a device *below* the root port?
It should be perfectly fine to do config accesses to a root port even
if the link is down.
> When that coincides with MMIO to an endpoint behind another root
> port of the same PCIe controller, the system takes a data fabric sync
> flood and resets. With the workaround, the same reads return all-ones
> and are logged by AER as Advisory Non-Fatal errors.
>
> Apply the workaround to affected root ports that implement the DPC RP
> Extensions, at enumeration and on resume, since the DPC state saved
> across suspend does not include this register.
Maybe this is a clue that the DPC state saved across suspend *should*
include this register? And also the mask and severity registers, as
pci_save_aer_state() does?
> Link: https://docs.amd.com/v/u/en-US/55449-PUB-1.21
> Cc: stable@vger.kernel.org
> Signed-off-by: Anthony Pighin <anthony.pighin@nokia.com>
> ---
> arch/x86/pci/fixup.c | 24 ++++++++++++++++++++++++
> 1 file changed, 24 insertions(+)
>
> diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
> index 795d81c7a4de..d8ea0e5292ae 100644
> --- a/arch/x86/pci/fixup.c
> +++ b/arch/x86/pci/fixup.c
> @@ -1180,3 +1180,27 @@ static void quirk_tuxeo_rp_d3(struct pci_dev *pdev)
> }
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x1502, quirk_tuxeo_rp_d3);
> #endif /* CONFIG_SUSPEND */
> +
> +/*
> + * AMD erratum #1146 (Family 17h Models 00h-0Fh Revision Guide 55449). The
> + * DPC RP PIO SysError register has inverted enable bits, so its zero reset
> + * value escalates Root Port PIO errors to a System Error that the processor
> + * may mishandle. Write the documented value to disable the escalation.
> + */
I think it's good to have the background here. We can always dig out
the commit log later, but it's a bit of a headache to do it.
> +static void quirk_amd_dpc_rp_pio_syserror(struct pci_dev *dev)
> +{
> + u16 dpc, val;
> +
> + dpc = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_DPC);
> + if (!dpc)
> + return;
> +
> + pci_read_config_word(dev, dpc + PCI_EXP_DPC_CAP, &val);
> + if (!(val & PCI_EXP_DPC_CAP_RP_EXT))
> + return;
> +
> + pci_write_config_dword(dev, dpc + PCI_EXP_DPC_RP_PIO_SYSERROR, 0x00070707);
> + pci_info(dev, "AMD erratum #1146: disable DPC RP PIO System Error escalation\n");
We never write PCI_EXP_DPC_RP_PIO_SYSERROR anywhere else, so I guess
we currently run with the default value or whatever firmware put
there?
This quirk will disable SysError generation on RP PIO errors
regardless of whether CONFIG_PCIE_DPC is set, and regardless of
whether firmware has granted DPC ownership to the OS.
Is that what we want? If not, I think checking dev->dpc_cap would do
this only if CONFIG_PCIE_DPC is set and the OS owns DPC.
I think sashiko is right that we should read/modify/write to preserve
the RsvdP bits in the register.
It would also be nice to complain only once at boot-time instead of
every resume. If we save/restore the register across suspend, that
should take care of that part and remove the need for the
DECLARE_PCI_FIXUP_RESUME_EARLY(), right?
> +}
> +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1453, quirk_amd_dpc_rp_pio_syserror);
> +DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_AMD, 0x1453, quirk_amd_dpc_rp_pio_syserror);
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-12-05 23:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20261203145647.707695-1-anthony.pighin@nokia.com>
2026-12-03 14:56 ` [PATCH v3 1/2] x86/PCI: Work around AMD erratum #1146 on Family 17h root ports Anthony Pighin
2026-12-04 16:02 ` Yazen Ghannam
2026-12-04 16:25 ` Anthony Pighin
2026-12-05 23:21 ` Bjorn Helgaas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox