* [PATCH 1/2] PCI: Add pci=noaer_recovery kernel boot option
2026-06-02 10:55 [PATCH 0/2] PCI: Add boot options to disable DPC and AER recovery Yury Murashka
@ 2026-06-02 10:55 ` Yury Murashka
2026-06-02 10:55 ` [PATCH 2/2] PCI: Add pci=nodpc " Yury Murashka
1 sibling, 0 replies; 3+ messages in thread
From: Yury Murashka @ 2026-06-02 10:55 UTC (permalink / raw)
To: bhelgaas; +Cc: corbet, skhan, linux-pci, linux-doc, linux-kernel, Yury Murashka
AER error recovery is part of the AER error handling subsystem in the
Linux kernel. On large modular systems with a complex PCIe tree, AER
recovery could cause unexpected behavior and side effects. Sometimes it
would be nice to have the option to keep the system in an unmodified
state and be able to handle PCIe errors from userspace.
Add pci=noaer_recovery kernel boot option to disable AER error recovery
when an uncorrectable error is reported. When this option is set, the
error status bits are still cleared, but no recovery actions are taken.
Signed-off-by: Yury Murashka <yurypm@arista.com>
---
Documentation/admin-guide/kernel-parameters.txt | 4 ++++
drivers/pci/pci.c | 2 ++
drivers/pci/pci.h | 2 ++
drivers/pci/pcie/err.c | 15 +++++++++++++++
4 files changed, 23 insertions(+)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 97007f4f69d4..cfec12d37677 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -5068,6 +5068,10 @@ Kernel parameters
noaer [PCIE] If the PCIEAER kernel config parameter is
enabled, this kernel boot option can be used to
disable the use of PCIE advanced error reporting.
+ noaer_recovery [PCIE] If the PCIEAER kernel config parameter is
+ enabled, this kernel boot option can be used to
+ disable AER error recovery when an uncorrectable
+ error is reported.
nodomains [PCI] Disable support for multiple PCI
root domains (aka PCI segments, in ACPI-speak).
nommconf [X86] Disable use of MMCONFIG for PCI
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index d34266651ad0..1f71f9c773c4 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -6725,6 +6725,8 @@ static int __init pci_setup(char *str)
pcie_ats_disabled = true;
} else if (!strcmp(str, "noaer")) {
pci_no_aer();
+ } else if (!strcmp(str, "noaer_recovery")) {
+ pci_no_aer_recovery();
} else if (!strcmp(str, "earlydump")) {
pci_early_dump = true;
} else if (!strncmp(str, "realloc=", 8)) {
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 4a14f88e543a..7a79df0ae712 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -1283,6 +1283,7 @@ static inline void of_pci_remove_host_bridge_node(struct pci_host_bridge *bridge
#ifdef CONFIG_PCIEAER
void pci_no_aer(void);
+void pci_no_aer_recovery(void);
void pci_aer_init(struct pci_dev *dev);
void pci_aer_exit(struct pci_dev *dev);
extern const struct attribute_group aer_stats_attr_group;
@@ -1294,6 +1295,7 @@ void pci_save_aer_state(struct pci_dev *dev);
void pci_restore_aer_state(struct pci_dev *dev);
#else
static inline void pci_no_aer(void) { }
+static inline void pci_no_aer_recovery(void) { }
static inline void pci_aer_init(struct pci_dev *d) { }
static inline void pci_aer_exit(struct pci_dev *d) { }
static inline void pci_aer_clear_fatal_status(struct pci_dev *dev) { }
diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c
index bebe4bc111d7..c022cfd85b93 100644
--- a/drivers/pci/pcie/err.c
+++ b/drivers/pci/pcie/err.c
@@ -21,6 +21,13 @@
#include "portdrv.h"
#include "../pci.h"
+static int pcie_aer_recovery_disable;
+
+void pci_no_aer_recovery(void)
+{
+ pcie_aer_recovery_disable = 1;
+}
+
static pci_ers_result_t merge_result(enum pci_ers_result orig,
enum pci_ers_result new)
{
@@ -216,6 +223,14 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev,
pci_ers_result_t status = PCI_ERS_RESULT_CAN_RECOVER;
struct pci_host_bridge *host = pci_find_host_bridge(dev->bus);
+ if (pcie_aer_recovery_disable) {
+ if (host->native_aer || pcie_ports_native) {
+ pcie_clear_device_status(dev);
+ pci_aer_clear_nonfatal_status(dev);
+ }
+ return status;
+ }
+
/*
* If the error was detected by a Root Port, Downstream Port, RCEC,
* or RCiEP, recovery runs on the device itself. For Ports, that
--
2.51.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH 2/2] PCI: Add pci=nodpc kernel boot option
2026-06-02 10:55 [PATCH 0/2] PCI: Add boot options to disable DPC and AER recovery Yury Murashka
2026-06-02 10:55 ` [PATCH 1/2] PCI: Add pci=noaer_recovery kernel boot option Yury Murashka
@ 2026-06-02 10:55 ` Yury Murashka
1 sibling, 0 replies; 3+ messages in thread
From: Yury Murashka @ 2026-06-02 10:55 UTC (permalink / raw)
To: bhelgaas; +Cc: corbet, skhan, linux-pci, linux-doc, linux-kernel, Yury Murashka
PCI DPC (Downstream Port Containment) support can be advertised by PCIe
devices, but it might not be fully supported in the firmware. On large
modular systems with a complex PCIe tree, enabling DPC could cause
unexpected behavior and side effects. Sometimes it would be nice to have
the option to keep the system in an unmodified state and be able to
handle PCIe errors from userspace.
Add pci=nodpc kernel boot option to disable PCI DPC. When this option
is set, DPC initialization, state save/restore, and recovery are all
skipped.
Signed-off-by: Yury Murashka <yurypm@arista.com>
---
Documentation/admin-guide/kernel-parameters.txt | 3 +++
drivers/pci/pci.c | 2 ++
drivers/pci/pci.h | 2 ++
drivers/pci/pcie/dpc.c | 16 +++++++++++++---
4 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index cfec12d37677..46a993c26dc0 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -5065,6 +5065,9 @@ Kernel parameters
through ports 0xC000-0xCFFF).
See http://wiki.osdev.org/PCI for more info
on the configuration access mechanisms.
+ nodpc [PCIE] If the PCIE_DPC kernel config parameter is
+ enabled, this kernel boot option can be used to
+ disable the use of PCIE DPC.
noaer [PCIE] If the PCIEAER kernel config parameter is
enabled, this kernel boot option can be used to
disable the use of PCIE advanced error reporting.
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 1f71f9c773c4..2882c7bbb358 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -6723,6 +6723,8 @@ static int __init pci_setup(char *str)
} else if (!strncmp(str, "noats", 5)) {
pr_info("PCIe: ATS is disabled\n");
pcie_ats_disabled = true;
+ } else if (!strcmp(str, "nodpc")) {
+ pci_no_dpc();
} else if (!strcmp(str, "noaer")) {
pci_no_aer();
} else if (!strcmp(str, "noaer_recovery")) {
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 7a79df0ae712..1b6f17dddf21 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -887,6 +887,7 @@ struct rcec_ea {
#endif
#ifdef CONFIG_PCIE_DPC
+void pci_no_dpc(void);
void pci_save_dpc_state(struct pci_dev *dev);
void pci_restore_dpc_state(struct pci_dev *dev);
void pci_dpc_init(struct pci_dev *pdev);
@@ -895,6 +896,7 @@ pci_ers_result_t dpc_reset_link(struct pci_dev *pdev);
bool pci_dpc_recovered(struct pci_dev *pdev);
unsigned int dpc_tlp_log_len(struct pci_dev *dev);
#else
+static inline void pci_no_dpc(void) { }
static inline void pci_save_dpc_state(struct pci_dev *dev) { }
static inline void pci_restore_dpc_state(struct pci_dev *dev) { }
static inline void pci_dpc_init(struct pci_dev *pdev) { }
diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c
index 2b779bd1d861..10d1a0e026d7 100644
--- a/drivers/pci/pcie/dpc.c
+++ b/drivers/pci/pcie/dpc.c
@@ -43,12 +43,19 @@ static const char * const rp_pio_error_string[] = {
"Memory Request Completion Timeout", /* Bit Position 18 */
};
+static int pcie_dpc_disable;
+
+void pci_no_dpc(void)
+{
+ pcie_dpc_disable = 1;
+}
+
void pci_save_dpc_state(struct pci_dev *dev)
{
struct pci_cap_saved_state *save_state;
u16 *cap;
- if (!pci_is_pcie(dev))
+ if (pcie_dpc_disable || !pci_is_pcie(dev))
return;
save_state = pci_find_saved_ext_cap(dev, PCI_EXT_CAP_ID_DPC);
@@ -64,7 +71,7 @@ void pci_restore_dpc_state(struct pci_dev *dev)
struct pci_cap_saved_state *save_state;
u16 *cap;
- if (!pci_is_pcie(dev))
+ if (pcie_dpc_disable || !pci_is_pcie(dev))
return;
save_state = pci_find_saved_ext_cap(dev, PCI_EXT_CAP_ID_DPC);
@@ -104,7 +111,7 @@ bool pci_dpc_recovered(struct pci_dev *pdev)
{
struct pci_host_bridge *host;
- if (!pdev->dpc_cap)
+ if (pcie_dpc_disable || !pdev->dpc_cap)
return false;
/*
@@ -404,6 +411,9 @@ void pci_dpc_init(struct pci_dev *pdev)
{
u16 cap;
+ if (pcie_dpc_disable)
+ return;
+
pdev->dpc_cap = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_DPC);
if (!pdev->dpc_cap)
return;
--
2.51.0
^ permalink raw reply related [flat|nested] 3+ messages in thread