Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

PCI/AER: Export pci_aer_unmask_internal_errors()

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() 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@amd.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Link: https://patch.msgid.link/20260114182055.46029-10-terry.bowman@amd.com
Co-developed-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>

authored by

Terry Bowman and committed by
Dave Jiang
6dc5fe21 0ff60f2e

+10 -3
+8 -3
drivers/pci/pcie/aer.c
··· 1120 1120 return true; 1121 1121 } 1122 1122 1123 - #ifdef CONFIG_PCIEAER_CXL 1124 - 1125 1123 /** 1126 1124 * pci_aer_unmask_internal_errors - unmask internal errors 1127 1125 * @dev: pointer to the pci_dev data structure ··· 1130 1132 * Note: AER must be enabled and supported by the device which must be 1131 1133 * checked in advance, e.g. with pcie_aer_is_native(). 1132 1134 */ 1133 - static void pci_aer_unmask_internal_errors(struct pci_dev *dev) 1135 + void pci_aer_unmask_internal_errors(struct pci_dev *dev) 1134 1136 { 1135 1137 int aer = dev->aer_cap; 1136 1138 u32 mask; ··· 1144 1146 pci_write_config_dword(dev, aer + PCI_ERR_COR_MASK, mask); 1145 1147 } 1146 1148 1149 + /* 1150 + * Internal errors are too device-specific to enable generally, however for CXL 1151 + * their behavior is standardized for conveying CXL protocol errors. 1152 + */ 1153 + EXPORT_SYMBOL_FOR_MODULES(pci_aer_unmask_internal_errors, "cxl_core"); 1154 + 1155 + #ifdef CONFIG_PCIEAER_CXL 1147 1156 static bool is_cxl_mem_dev(struct pci_dev *dev) 1148 1157 { 1149 1158 /*
+2
include/linux/aer.h
··· 56 56 #if defined(CONFIG_PCIEAER) 57 57 int pci_aer_clear_nonfatal_status(struct pci_dev *dev); 58 58 int pcie_aer_is_native(struct pci_dev *dev); 59 + void pci_aer_unmask_internal_errors(struct pci_dev *dev); 59 60 #else 60 61 static inline int pci_aer_clear_nonfatal_status(struct pci_dev *dev) 61 62 { 62 63 return -EINVAL; 63 64 } 64 65 static inline int pcie_aer_is_native(struct pci_dev *dev) { return 0; } 66 + static inline void pci_aer_unmask_internal_errors(struct pci_dev *dev) { } 65 67 #endif 66 68 67 69 void pci_print_aer(struct pci_dev *dev, int aer_severity,