Skip to content

Commit e778ffe

Browse files
fdefrancrafaeljw
authored andcommitted
ACPI: extlog: Trace CPER PCI Express Error Section
I/O Machine Check Architecture events may signal failing PCIe components or links. The AER event contains details on what was happening on the wire when the error was signaled. Trace the CPER PCIe Error section (UEFI v2.11, Appendix N.2.7) reported by the I/O MCA. Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Signed-off-by: Fabio M. De Francesco <fabio.m.de.francesco@linux.intel.com> Link: https://patch.msgid.link/20260114101543.85926-3-fabio.m.de.francesco@linux.intel.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent a2995f7 commit e778ffe

2 files changed

Lines changed: 35 additions & 1 deletion

File tree

drivers/acpi/acpi_extlog.c

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,36 @@ static int print_extlog_rcd(const char *pfx,
132132
return 1;
133133
}
134134

135+
static void extlog_print_pcie(struct cper_sec_pcie *pcie_err,
136+
int severity)
137+
{
138+
#ifdef ACPI_APEI_PCIEAER
139+
struct aer_capability_regs *aer;
140+
struct pci_dev *pdev;
141+
unsigned int devfn;
142+
unsigned int bus;
143+
int aer_severity;
144+
int domain;
145+
146+
if (!(pcie_err->validation_bits & CPER_PCIE_VALID_DEVICE_ID &&
147+
pcie_err->validation_bits & CPER_PCIE_VALID_AER_INFO))
148+
return;
149+
150+
aer_severity = cper_severity_to_aer(severity);
151+
aer = (struct aer_capability_regs *)pcie_err->aer_info;
152+
domain = pcie_err->device_id.segment;
153+
bus = pcie_err->device_id.bus;
154+
devfn = PCI_DEVFN(pcie_err->device_id.device,
155+
pcie_err->device_id.function);
156+
pdev = pci_get_domain_bus_and_slot(domain, bus, devfn);
157+
if (!pdev)
158+
return;
159+
160+
pci_print_aer(pdev, aer_severity, aer);
161+
pci_dev_put(pdev);
162+
#endif
163+
}
164+
135165
static int extlog_print(struct notifier_block *nb, unsigned long val,
136166
void *data)
137167
{
@@ -183,6 +213,10 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
183213
if (gdata->error_data_length >= sizeof(*mem))
184214
trace_extlog_mem_event(mem, err_seq, fru_id, fru_text,
185215
(u8)gdata->error_severity);
216+
} else if (guid_equal(sec_type, &CPER_SEC_PCIE)) {
217+
struct cper_sec_pcie *pcie_err = acpi_hest_get_payload(gdata);
218+
219+
extlog_print_pcie(pcie_err, gdata->error_severity);
186220
} else {
187221
void *err = acpi_hest_get_payload(gdata);
188222

drivers/pci/pcie/aer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ void pci_print_aer(struct pci_dev *dev, int aer_severity,
973973
pcie_print_tlp_log(dev, &aer->header_log, info.level,
974974
dev_fmt(" "));
975975
}
976-
EXPORT_SYMBOL_NS_GPL(pci_print_aer, "CXL");
976+
EXPORT_SYMBOL_GPL(pci_print_aer);
977977

978978
/**
979979
* add_error_device - list device to be handled

0 commit comments

Comments
 (0)