aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/apei/cper.c18
-rw-r--r--drivers/acpi/apei/ghes.c4
-rw-r--r--drivers/pci/pcie/aer/aerdrv_core.c5
-rw-r--r--drivers/pci/pcie/aer/aerdrv_errprint.c4
-rw-r--r--include/linux/aer.h5
5 files changed, 12 insertions, 24 deletions
diff --git a/drivers/acpi/apei/cper.c b/drivers/acpi/apei/cper.c
index fefc2ca7cc3e..33dc6a004802 100644
--- a/drivers/acpi/apei/cper.c
+++ b/drivers/acpi/apei/cper.c
@@ -250,10 +250,6 @@ static const char *cper_pcie_port_type_strs[] = {
250static 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,
251 const struct acpi_hest_generic_data *gdata) 251 const struct acpi_hest_generic_data *gdata)
252{ 252{
253#ifdef CONFIG_ACPI_APEI_PCIEAER
254 struct pci_dev *dev;
255#endif
256
257 if (pcie->validation_bits & CPER_PCIE_VALID_PORT_TYPE) 253 if (pcie->validation_bits & CPER_PCIE_VALID_PORT_TYPE)
258 printk("%s""port_type: %d, %s\n", pfx, pcie->port_type, 254 printk("%s""port_type: %d, %s\n", pfx, pcie->port_type,
259 pcie->port_type < ARRAY_SIZE(cper_pcie_port_type_strs) ? 255 pcie->port_type < ARRAY_SIZE(cper_pcie_port_type_strs) ?
@@ -285,20 +281,6 @@ static void cper_print_pcie(const char *pfx, const struct cper_sec_pcie *pcie,
285 printk( 281 printk(
286 "%s""bridge: secondary_status: 0x%04x, control: 0x%04x\n", 282 "%s""bridge: secondary_status: 0x%04x, control: 0x%04x\n",
287 pfx, pcie->bridge.secondary_status, pcie->bridge.control); 283 pfx, pcie->bridge.secondary_status, pcie->bridge.control);
288#ifdef CONFIG_ACPI_APEI_PCIEAER
289 dev = pci_get_domain_bus_and_slot(pcie->device_id.segment,
290 pcie->device_id.bus, pcie->device_id.function);
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;
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);
301#endif
302} 284}
303 285
304static const char *apei_estatus_section_flag_strs[] = { 286static const char *apei_estatus_section_flag_strs[] = {
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index d668a8ae602b..403baf4dffc1 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -454,7 +454,9 @@ static void ghes_do_proc(struct ghes *ghes,
454 aer_severity = cper_severity_to_aer(sev); 454 aer_severity = cper_severity_to_aer(sev);
455 aer_recover_queue(pcie_err->device_id.segment, 455 aer_recover_queue(pcie_err->device_id.segment,
456 pcie_err->device_id.bus, 456 pcie_err->device_id.bus,
457 devfn, aer_severity); 457 devfn, aer_severity,
458 (struct aer_capability_regs *)
459 pcie_err->aer_info);
458 } 460 }
459 461
460 } 462 }
diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c
index 8ec8b4f48560..0f4554e48cc5 100644
--- a/drivers/pci/pcie/aer/aerdrv_core.c
+++ b/drivers/pci/pcie/aer/aerdrv_core.c
@@ -580,6 +580,7 @@ struct aer_recover_entry
580 u8 devfn; 580 u8 devfn;
581 u16 domain; 581 u16 domain;
582 int severity; 582 int severity;
583 struct aer_capability_regs *regs;
583}; 584};
584 585
585static DEFINE_KFIFO(aer_recover_ring, struct aer_recover_entry, 586static DEFINE_KFIFO(aer_recover_ring, struct aer_recover_entry,
@@ -593,7 +594,7 @@ static DEFINE_SPINLOCK(aer_recover_ring_lock);
593static DECLARE_WORK(aer_recover_work, aer_recover_work_func); 594static DECLARE_WORK(aer_recover_work, aer_recover_work_func);
594 595
595void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn, 596void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn,
596 int severity) 597 int severity, struct aer_capability_regs *aer_regs)
597{ 598{
598 unsigned long flags; 599 unsigned long flags;
599 struct aer_recover_entry entry = { 600 struct aer_recover_entry entry = {
@@ -601,6 +602,7 @@ void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn,
601 .devfn = devfn, 602 .devfn = devfn,
602 .domain = domain, 603 .domain = domain,
603 .severity = severity, 604 .severity = severity,
605 .regs = aer_regs,
604 }; 606 };
605 607
606 spin_lock_irqsave(&aer_recover_ring_lock, flags); 608 spin_lock_irqsave(&aer_recover_ring_lock, flags);
@@ -627,6 +629,7 @@ static void aer_recover_work_func(struct work_struct *work)
627 PCI_SLOT(entry.devfn), PCI_FUNC(entry.devfn)); 629 PCI_SLOT(entry.devfn), PCI_FUNC(entry.devfn));
628 continue; 630 continue;
629 } 631 }
632 cper_print_aer(pdev, entry.severity, entry.regs);
630 do_recovery(pdev, entry.severity); 633 do_recovery(pdev, entry.severity);
631 pci_dev_put(pdev); 634 pci_dev_put(pdev);
632 } 635 }
diff --git a/drivers/pci/pcie/aer/aerdrv_errprint.c b/drivers/pci/pcie/aer/aerdrv_errprint.c
index 5ab14251839d..2c7c9f5f592c 100644
--- a/drivers/pci/pcie/aer/aerdrv_errprint.c
+++ b/drivers/pci/pcie/aer/aerdrv_errprint.c
@@ -220,7 +220,7 @@ int cper_severity_to_aer(int cper_severity)
220} 220}
221EXPORT_SYMBOL_GPL(cper_severity_to_aer); 221EXPORT_SYMBOL_GPL(cper_severity_to_aer);
222 222
223void cper_print_aer(const char *prefix, struct pci_dev *dev, int cper_severity, 223void cper_print_aer(struct pci_dev *dev, int cper_severity,
224 struct aer_capability_regs *aer) 224 struct aer_capability_regs *aer)
225{ 225{
226 int aer_severity, layer, agent, status_strs_size, tlp_header_valid = 0; 226 int aer_severity, layer, agent, status_strs_size, tlp_header_valid = 0;
@@ -244,7 +244,7 @@ void cper_print_aer(const char *prefix, struct pci_dev *dev, int cper_severity,
244 agent = AER_GET_AGENT(aer_severity, status); 244 agent = AER_GET_AGENT(aer_severity, status);
245 dev_err(&dev->dev, "aer_status: 0x%08x, aer_mask: 0x%08x\n", 245 dev_err(&dev->dev, "aer_status: 0x%08x, aer_mask: 0x%08x\n",
246 status, mask); 246 status, mask);
247 cper_print_bits(prefix, status, status_strs, status_strs_size); 247 cper_print_bits("", status, status_strs, status_strs_size);
248 dev_err(&dev->dev, "aer_layer=%s, aer_agent=%s\n", 248 dev_err(&dev->dev, "aer_layer=%s, aer_agent=%s\n",
249 aer_error_layer[layer], aer_agent_string[agent]); 249 aer_error_layer[layer], aer_agent_string[agent]);
250 if (aer_severity != AER_CORRECTABLE) 250 if (aer_severity != AER_CORRECTABLE)
diff --git a/include/linux/aer.h b/include/linux/aer.h
index ec10e1b24c1c..737f90ab4b62 100644
--- a/include/linux/aer.h
+++ b/include/linux/aer.h
@@ -49,10 +49,11 @@ static inline int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev)
49} 49}
50#endif 50#endif
51 51
52extern void cper_print_aer(const char *prefix, struct pci_dev *dev, 52extern void cper_print_aer(struct pci_dev *dev,
53 int cper_severity, struct aer_capability_regs *aer); 53 int cper_severity, struct aer_capability_regs *aer);
54extern int cper_severity_to_aer(int cper_severity); 54extern int cper_severity_to_aer(int cper_severity);
55extern void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn, 55extern void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn,
56 int severity); 56 int severity,
57 struct aer_capability_regs *aer_regs);
57#endif //_AER_H_ 58#endif //_AER_H_
58 59