Skip to contentSkip to conversation

Correct AER severity for printing AER information

PATCH In review Tyler Baicar 2 participants 4 messages Sep 12, 2016 – Sep 13, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Correct AER severity for printing AER information

AER severity handling has two issues that cause the AER information to be printed incorrectly. The first issue is that the function to calculate the AER severity is called twice in the code path to print the AER information. The second issue is that the original call to calculate the AER severity expects the CPER severity but is recieving the GHES severity.

Tyler Baicar (2):
PCI/AER: Remove duplicate AER severity translation
acpi: apei: send correct severity to calculate AER severity

 drivers/acpi/apei/ghes.c               | 2 +-
 drivers/pci/pcie/aer/aerdrv_errprint.c | 6 ++----
 include/linux/aer.h                    | 2 +-
 3 files changed, 4 insertions(+), 6 deletions(-)
Signature · 3 lines
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.
#1 lore raw

PATCH 1/2 PCI/AER: Remove duplicate AER severity translation

Currently the AER severity is being translated twice in the code flow for PCIe errors. It is first translated in ghes_do_proc() before calling into the AER driver. Then it is translated again when the AER driver calls cper_print_aer(). This causes the severity that is used in cper_print_aer() to be incorrect. Remove the second translation that is in cper_print_aer() since this function is already recieving the correct AER severity.

---
 drivers/pci/pcie/aer/aerdrv_errprint.c | 6 ++----
 include/linux/aer.h                    | 2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)
drivers/pci/pcie/aer/aerdrv_errprint.c +2 -4
index 167fe41..54c4b69 100644
@@ -219,15 +219,13 @@ int cper_severity_to_aer(int cper_severity)
 }
 EXPORT_SYMBOL_GPL(cper_severity_to_aer);
 
-void cper_print_aer(struct pci_dev *dev, int cper_severity,
+void cper_print_aer(struct pci_dev *dev, int aer_severity,
 		    struct aer_capability_regs *aer)
 {
-	int aer_severity, layer, agent, status_strs_size, tlp_header_valid = 0;
+	int layer, agent, status_strs_size, tlp_header_valid = 0;
 	u32 status, mask;
 	const char **status_strs;
 
-	aer_severity = cper_severity_to_aer(cper_severity);
-
 	if (aer_severity == AER_CORRECTABLE) {
 		status = aer->cor_status;
 		mask = aer->cor_mask;
include/linux/aer.h +1 -1
index 1640493..04602cb 100644
@@ -63,7 +63,7 @@ static inline int pci_cleanup_aer_error_status_regs(struct pci_dev *dev)
 }
 #endif
 
-void cper_print_aer(struct pci_dev *dev, int cper_severity,
+void cper_print_aer(struct pci_dev *dev, int aer_severity,
 		    struct aer_capability_regs *aer);
 int cper_severity_to_aer(int cper_severity);
 void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn,
Signature · 3 lines
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.
#2 lore raw

PATCH 2/2 acpi: apei: send correct severity to calculate AER severity

In reply to Tyler Baicar

Currently the AER severity is calculated by calling cper_severity_to_aer(), but the parameter sent is actually the GHES severity. This causes the AER severity to be incorrect. Fix the parameter to be the CPER severity instead of the GHES severity.

---
 drivers/acpi/apei/ghes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/apei/ghes.c +1 -1
index 60746ef..f0a029e 100644
@@ -457,7 +457,7 @@ static void ghes_do_proc(struct ghes *ghes,
 
 				devfn = PCI_DEVFN(pcie_err->device_id.device,
 						  pcie_err->device_id.function);
-				aer_severity = cper_severity_to_aer(sev);
+				aer_severity = cper_severity_to_aer(gdata->error_severity);
 
 				/*
 				 * If firmware reset the component to contain
Signature · 3 lines
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.
Reviewed-by on the v1 series
#3 lore raw
In reply to Tyler Baicar
Quoted 7 lines · Tyler Baicar

AER severity handling has two issues that cause the AER information to be printed incorrectly. The first issue is that the function to calculate the AER severity is called twice in the code path to print the AER information. The second issue is that the original call to calculate the AER severity expects the CPER severity but is recieving the GHES severity.

Quoted 8 lines

Tyler Baicar (2):
PCI/AER: Remove duplicate AER severity translation
acpi: apei: send correct severity to calculate AER severity

 drivers/acpi/apei/ghes.c               | 2 +-
 drivers/pci/pcie/aer/aerdrv_errprint.c | 6 ++----
 include/linux/aer.h                    | 2 +-
 3 files changed, 4 insertions(+), 6 deletions(-)

For both:

Signature · 7 lines
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
--