linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 0/2] Correct AER severity for printing AER information
@ 2016-09-14 21:14 Tyler Baicar
  2016-09-14 21:14 ` [PATCH V2 1/2] PCI/AER: Remove duplicate AER severity translation Tyler Baicar
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Tyler Baicar @ 2016-09-14 21:14 UTC (permalink / raw)
  To: rjw, lenb, bhelgaas, paul.gortmaker, sudipm.mukherjee, axboe,
	izumi.taku, linux-acpi, linux-kernel, linux-pci
  Cc: bp, 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.

V2: Fix minor typo in commit text.

V1: https://lkml.org/lkml/2016/9/12/1075

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(-)

-- 
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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH V2 1/2] PCI/AER: Remove duplicate AER severity translation
  2016-09-14 21:14 [PATCH V2 0/2] Correct AER severity for printing AER information Tyler Baicar
@ 2016-09-14 21:14 ` Tyler Baicar
  2016-09-14 21:14 ` [PATCH V2 2/2] acpi: apei: send correct severity to calculate AER severity Tyler Baicar
  2016-09-20 19:41 ` [PATCH V2 0/2] Correct AER severity for printing AER information Bjorn Helgaas
  2 siblings, 0 replies; 5+ messages in thread
From: Tyler Baicar @ 2016-09-14 21:14 UTC (permalink / raw)
  To: rjw, lenb, bhelgaas, paul.gortmaker, sudipm.mukherjee, axboe,
	izumi.taku, linux-acpi, linux-kernel, linux-pci
  Cc: bp, Tyler Baicar

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 receiving the
correct AER severity.

Signed-off-by: Tyler Baicar <tbaicar@codeaurora.org>
Reviewed-by: Borislav Petkov <bp@suse.de>
---
 drivers/pci/pcie/aer/aerdrv_errprint.c | 6 ++----
 include/linux/aer.h                    | 2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/pci/pcie/aer/aerdrv_errprint.c b/drivers/pci/pcie/aer/aerdrv_errprint.c
index 167fe41..54c4b69 100644
--- a/drivers/pci/pcie/aer/aerdrv_errprint.c
+++ b/drivers/pci/pcie/aer/aerdrv_errprint.c
@@ -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;
diff --git a/include/linux/aer.h b/include/linux/aer.h
index 1640493..04602cb 100644
--- a/include/linux/aer.h
+++ b/include/linux/aer.h
@@ -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,
-- 
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.

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH V2 2/2] acpi: apei: send correct severity to calculate AER severity
  2016-09-14 21:14 [PATCH V2 0/2] Correct AER severity for printing AER information Tyler Baicar
  2016-09-14 21:14 ` [PATCH V2 1/2] PCI/AER: Remove duplicate AER severity translation Tyler Baicar
@ 2016-09-14 21:14 ` Tyler Baicar
  2016-09-20 19:41 ` [PATCH V2 0/2] Correct AER severity for printing AER information Bjorn Helgaas
  2 siblings, 0 replies; 5+ messages in thread
From: Tyler Baicar @ 2016-09-14 21:14 UTC (permalink / raw)
  To: rjw, lenb, bhelgaas, paul.gortmaker, sudipm.mukherjee, axboe,
	izumi.taku, linux-acpi, linux-kernel, linux-pci
  Cc: bp, 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.

Signed-off-by: Tyler Baicar <tbaicar@codeaurora.org>
Reviewed-by: Borislav Petkov <bp@suse.de>
---
 drivers/acpi/apei/ghes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index 60746ef..f0a029e 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -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
-- 
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.

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH V2 0/2] Correct AER severity for printing AER information
  2016-09-14 21:14 [PATCH V2 0/2] Correct AER severity for printing AER information Tyler Baicar
  2016-09-14 21:14 ` [PATCH V2 1/2] PCI/AER: Remove duplicate AER severity translation Tyler Baicar
  2016-09-14 21:14 ` [PATCH V2 2/2] acpi: apei: send correct severity to calculate AER severity Tyler Baicar
@ 2016-09-20 19:41 ` Bjorn Helgaas
  2016-09-21  0:27   ` Rafael J. Wysocki
  2 siblings, 1 reply; 5+ messages in thread
From: Bjorn Helgaas @ 2016-09-20 19:41 UTC (permalink / raw)
  To: Tyler Baicar
  Cc: rjw, lenb, bhelgaas, paul.gortmaker, sudipm.mukherjee, axboe,
	izumi.taku, linux-acpi, linux-kernel, linux-pci, bp

On Wed, Sep 14, 2016 at 03:14:44PM -0600, Tyler Baicar wrote:
> 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.
> 
> V2: Fix minor typo in commit text.
> 
> V1: https://lkml.org/lkml/2016/9/12/1075
> 
> 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(-)

I applied both to pci/aer for v4.9, thanks!

Rafael, the second one is strictly ACPI, and I'd be happy to let you
deal with it if you prefer.

Bjorn

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH V2 0/2] Correct AER severity for printing AER information
  2016-09-20 19:41 ` [PATCH V2 0/2] Correct AER severity for printing AER information Bjorn Helgaas
@ 2016-09-21  0:27   ` Rafael J. Wysocki
  0 siblings, 0 replies; 5+ messages in thread
From: Rafael J. Wysocki @ 2016-09-21  0:27 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Tyler Baicar, lenb, bhelgaas, paul.gortmaker, sudipm.mukherjee,
	axboe, izumi.taku, linux-acpi, linux-kernel, linux-pci, bp

On Tuesday, September 20, 2016 02:41:03 PM Bjorn Helgaas wrote:
> On Wed, Sep 14, 2016 at 03:14:44PM -0600, Tyler Baicar wrote:
> > 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.
> > 
> > V2: Fix minor typo in commit text.
> > 
> > V1: https://lkml.org/lkml/2016/9/12/1075
> > 
> > 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(-)
> 
> I applied both to pci/aer for v4.9, thanks!
> 
> Rafael, the second one is strictly ACPI, and I'd be happy to let you
> deal with it if you prefer.

It can go in via PCI I think.  Either way is fine by me actually. :-)

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-09-21  0:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-14 21:14 [PATCH V2 0/2] Correct AER severity for printing AER information Tyler Baicar
2016-09-14 21:14 ` [PATCH V2 1/2] PCI/AER: Remove duplicate AER severity translation Tyler Baicar
2016-09-14 21:14 ` [PATCH V2 2/2] acpi: apei: send correct severity to calculate AER severity Tyler Baicar
2016-09-20 19:41 ` [PATCH V2 0/2] Correct AER severity for printing AER information Bjorn Helgaas
2016-09-21  0:27   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).