aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/apei/cper.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/apei/cper.c')
-rw-r--r--drivers/acpi/apei/cper.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/acpi/apei/cper.c b/drivers/acpi/apei/cper.c
index e6defd86b424..1e5d8a40101e 100644
--- a/drivers/acpi/apei/cper.c
+++ b/drivers/acpi/apei/cper.c
@@ -29,6 +29,7 @@
29#include <linux/time.h> 29#include <linux/time.h>
30#include <linux/cper.h> 30#include <linux/cper.h>
31#include <linux/acpi.h> 31#include <linux/acpi.h>
32#include <linux/pci.h>
32#include <linux/aer.h> 33#include <linux/aer.h>
33 34
34/* 35/*
@@ -249,6 +250,10 @@ static const char *cper_pcie_port_type_strs[] = {
249static void cper_print_pcie(const char *pfx, const struct cper_sec_pcie *pcie, 250static void cper_print_pcie(const char *pfx, const struct cper_sec_pcie *pcie,
250 const struct acpi_hest_generic_data *gdata) 251 const struct acpi_hest_generic_data *gdata)
251{ 252{
253#ifdef CONFIG_ACPI_APEI_PCIEAER
254 struct pci_dev *dev;
255#endif
256
252 if (pcie->validation_bits & CPER_PCIE_VALID_PORT_TYPE) 257 if (pcie->validation_bits & CPER_PCIE_VALID_PORT_TYPE)
253 printk("%s""port_type: %d, %s\n", pfx, pcie->port_type, 258 printk("%s""port_type: %d, %s\n", pfx, pcie->port_type,
254 pcie->port_type < ARRAY_SIZE(cper_pcie_port_type_strs) ? 259 pcie->port_type < ARRAY_SIZE(cper_pcie_port_type_strs) ?
@@ -281,10 +286,18 @@ static void cper_print_pcie(const char *pfx, const struct cper_sec_pcie *pcie,
281 "%s""bridge: secondary_status: 0x%04x, control: 0x%04x\n", 286 "%s""bridge: secondary_status: 0x%04x, control: 0x%04x\n",
282 pfx, pcie->bridge.secondary_status, pcie->bridge.control); 287 pfx, pcie->bridge.secondary_status, pcie->bridge.control);
283#ifdef CONFIG_ACPI_APEI_PCIEAER 288#ifdef CONFIG_ACPI_APEI_PCIEAER
284 if (pcie->validation_bits & CPER_PCIE_VALID_AER_INFO) { 289 dev = pci_get_domain_bus_and_slot(pcie->device_id.segment,
285 struct aer_capability_regs *aer_regs = (void *)pcie->aer_info; 290 pcie->device_id.bus, pcie->device_id.function);
286 cper_print_aer(pfx, gdata->error_severity, aer_regs); 291 if (!dev) {
292 pr_err("PCI AER Cannot get PCI device %04x:%02x:%02x.%d\n",
293 pcie->device_id.segment, pcie->device_id.bus,
294 pcie->device_id.slot, pcie->device_id.function);
295 return;
287 } 296 }
297 if (pcie->validation_bits & CPER_PCIE_VALID_AER_INFO)
298 cper_print_aer(pfx, dev, gdata->error_severity,
299 (struct aer_capability_regs *) pcie->aer_info);
300 pci_dev_put(dev);
288#endif 301#endif
289} 302}
290 303