Re: [PATCH v14 09/34] PCI/AER: Export pci_aer_unmask_internal_errors()
From: dan.j.williams
Date: Mon Jan 19 2026 - 21:09:45 EST
Terry Bowman wrote:
> Internal PCIe errors are not enabled by default during initialization. This
> creates a problem for CXL drivers, which rely on PCIe Correctable and
> Uncorrectable Internal Errors to receive CXL protocol error notifications.
>
> Export pci_aer_unmask_internal_errors() so CXL and other drivers can
> enable internal PCIe errors.
I folded in the following to this patch because opening up internal
errors for PCIe drivers in general is not a goal.
1: cb9a15481d8c ! 1: 7433e0204753 PCI/AER: Export pci_aer_unmask_internal_errors()
@@ Metadata
## Commit message ##
PCI/AER: Export pci_aer_unmask_internal_errors()
- Internal PCIe errors are not enabled by default during initialization. This
- creates a problem for CXL drivers, which rely on PCIe Correctable and
- Uncorrectable Internal Errors to receive CXL protocol error notifications.
+ Internal PCIe errors are not enabled by default during initialization
+ because their behavior is too device-specific and there is no standard way
+ to reason about them. However, for CXL an internal error is the standard
+ mechanism for conveying CXL protocol errors.
- Export pci_aer_unmask_internal_errors() so CXL and other drivers can
- enable internal PCIe errors.
+ Export pci_aer_unmask_internal_errors() for CXL, but make it clear that
+ they are only meant for CXL and the status quo for leaving them masked for
+ PCIe in general remains.
Signed-off-by: Terry Bowman <terry.bowman@xxxxxxx>
Reviewed-by: Dave Jiang <dave.jiang@xxxxxxxxx>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@xxxxxxxxxxxxxxx>
Reviewed-by: Jonathan Cameron <jonathan.cameron@xxxxxxxxxx>
Link: https://patch.msgid.link/20260114182055.46029-10-terry.bowman@xxxxxxx
+ Co-developed-by: Dan Williams <dan.j.williams@xxxxxxxxx>
Signed-off-by: Dan Williams <dan.j.williams@xxxxxxxxx>
## include/linux/aer.h ##
@@ drivers/pci/pcie/aer.c: static bool find_source_device(struct pci_dev *parent,
int aer = dev->aer_cap;
u32 mask;
@@ drivers/pci/pcie/aer.c: static void pci_aer_unmask_internal_errors(struct pci_dev *dev)
- mask &= ~PCI_ERR_COR_INTERNAL;
pci_write_config_dword(dev, aer + PCI_ERR_COR_MASK, mask);
}
-+EXPORT_SYMBOL_GPL(pci_aer_unmask_internal_errors);
++/*
++ * Internal errors are too device-specific to enable generally, however for CXL
++ * their behavior is standardized for conveying CXL protocol errors.
++ */
++EXPORT_SYMBOL_FOR_MODULES(pci_aer_unmask_internal_errors, "cxl_core");
++
+#ifdef CONFIG_PCIEAER_CXL
static bool is_cxl_mem_dev(struct pci_dev *dev)
{