Skip to contentSkip to conversation

Fix long standing AER Error Handling Issues

PATCH Superseded Naveen Naidu 3 participants 12 messages Oct 4, 2021 – Oct 5, 2021

Subsystems (2)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v3 cover Fix long standing AER Error Handling Issues

This patch series aims at fixing some of the AER error handling issues we have.

Currently we have the following issues:
- Confusing message in aer_print_error()
- aer_err_info not being initialized completely in DPC path before we print the AER logs
- A bug [1] in clearing of AER registers in the native AER path

[1] https://lore.kernel.org/linux-pci/20151229155822.GA17321@localhost/

The primary aim of this patch series is to converge the APEI path and the native AER error handling paths. In our current code, we find that we have two different behaviours (especially when it comes to clearing of the AER registers) for the same functionality.

This patch series, tries to bring the same semantics and hence more commonanlity between the APEI part of code and the native OS handling of AER errors.

PATCH 1:
- Fixes the first issue

PATCH 2 - 4:
- Fixes the second issue
- "Patch 3/8" is dependent on "Patch 2/3" in the series

PATCH 5 - 7
- Deals with converging the various paths and to bring more commonality between them
- "Patch 6/8" depends on "Patch 1/8"

PATCH 8:
- Adds extra information in AER error logs.

Thanks,
Naveen Naidu

Changelog
=========

v3:
- Fix up mail formatting and resend the patches again. Really sorry for all the spam. I messed up in the first try and instead of fixing it well in v2, I messed up again. I have fixed everything now. Apologies for the inconvenience caused. I'll make sure to not repeat it again.

v2:
- Apologies for the mistake, I forgot to cc the linux-pci mailing list.Resent the email with cc to linux-pci

Naveen Naidu (8):
[PATCH v3 1/8] PCI/AER: Remove ID from aer_agent_string[]
[PATCH v3 2/8] PCI: Cleanup struct aer_err_info
[PATCH v3 3/8] PCI/DPC: Initialize info->id in dpc_process_error()
[PATCH v3 4/8] PCI/DPC: Use pci_aer_clear_status() in dpc_process_error() [PATCH v3 5/8] PCI/DPC: Converge EDR and DPC Path of clearing AER registers [PATCH v3 6/8] PCI/AER: Clear error device AER registers in aer_irq() [PATCH v3 7/8] PCI/ERR: Remove redundant clearing of AER register in pcie_do_recovery() [PATCH v3 8/8] PCI/AER: Include DEVCTL in aer_print_error()

 drivers/pci/pci.h      |  23 +++-
 drivers/pci/pcie/aer.c | 265 ++++++++++++++++++++++++++++-------------
 drivers/pci/pcie/dpc.c |   9 +-
 drivers/pci/pcie/err.c |   9 +-
 4 files changed, 207 insertions(+), 99 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH v3 1/8 PCI/AER: Remove ID from aer_agent_string[]

Before 010caed4ccb6 ("PCI/AER: Decode Error Source RequesterID") the AER error logs looked like:

pcieport 0000:00:03.0: AER: Corrected error received: id=0018
pcieport 0000:00:03.0: PCIe Bus Error: severity=Corrected, type=Data Link Layer, id=0018 (Receiver ID)
pcieport 0000:00:03.0: device [1b36:000c] error status/mask=00000040/0000e000
pcieport 0000:00:03.0: [ 6] BadTLP

In 010caed4ccb6 ("PCI/AER: Decode Error Source Requester ID"), the "id" field was removed from the AER error logs, so currently AER logs look like:

pcieport 0000:00:03.0: AER: Corrected error received: 0000:00:03:0
pcieport 0000:00:03.0: PCIe Bus Error: severity=Corrected, type=Data Link Layer, (Receiver ID)
pcieport 0000:00:03.0: device [1b36:000c] error status/mask=00000040/0000e000
pcieport 0000:00:03.0: [ 6] BadTLP

The second line in the above logs prints "(Receiver ID)", even when there is no "id" in the log line. This is confusing.

Remove the "ID" from the aer_agent_string[]. The error logs will look as follows (Sample from dummy error injected by aer-inject):

pcieport 0000:00:03.0: AER: Corrected error received: 0000:00:03.0
pcieport 0000:00:03.0: PCIe Bus Error: severity=Corrected, type=Data Link Layer, (Receiver)
pcieport 0000:00:03.0: device [1b36:000c] error status/mask=00000040/0000e000
pcieport 0000:00:03.0: [ 6] BadTLP

---
 drivers/pci/pcie/aer.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/pci/pcie/aer.c +5 -5
index 9784fdcf3006..241ff361b43c 100644
@@ -516,10 +516,10 @@ static const char *aer_uncorrectable_error_string[] = {
 };
 
 static const char *aer_agent_string[] = {
-	"Receiver ID",
-	"Requester ID",
-	"Completer ID",
-	"Transmitter ID"
+	"Receiver",
+	"Requester",
+	"Completer",
+	"Transmitter"
 };
 
 #define aer_stats_dev_attr(name, stats_array, strings_array,		\
@@ -703,7 +703,7 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info)
 	const char *level;
 
 	if (!info->status) {
-		pci_err(dev, "PCIe Bus Error: severity=%s, type=Inaccessible, (Unregistered Agent ID)\n",
+		pci_err(dev, "PCIe Bus Error: severity=%s, type=Inaccessible, (Unregistered Agent)\n",
 			aer_error_severity_string[info->severity]);
 		goto out;
 	}
Signature · 1 line
2.25.1
#3 lore raw

PATCH v3 2/8 PCI: Cleanup struct aer_err_info

In reply to Naveen Naidu

The id, status and the mask fields of the struct aer_err_info comes directly from the registers, hence their sizes should be explicit.

The length of these registers are:
- id: 16 bits - Represents the Error Source Requester ID
- status: 32 bits - COR/UNCOR Error Status
- mask: 32 bits - COR/UNCOR Error Mask

Since the length of the above registers are even, use u16 and u32 to represent their values.

Also remove the __pad fields.

"pahole" was run on the modified struct aer_err_info and the size remains unchanged.

---
 drivers/pci/pci.h | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/pci/pci.h +3 -5
index 1cce56c2aea0..9be7a966fda7 100644
@@ -427,18 +427,16 @@ struct aer_err_info {
 	struct pci_dev *dev[AER_MAX_MULTI_ERR_DEVICES];
 	int error_dev_num;
 
-	unsigned int id:16;
+	u16	id;
 
 	unsigned int severity:2;	/* 0:NONFATAL | 1:FATAL | 2:COR */
-	unsigned int __pad1:5;
 	unsigned int multi_error_valid:1;
 
 	unsigned int first_error:5;
-	unsigned int __pad2:2;
 	unsigned int tlp_header_valid:1;
 
-	unsigned int status;		/* COR/UNCOR Error Status */
-	unsigned int mask;		/* COR/UNCOR Error Mask */
+	u32 status;		/* COR/UNCOR Error Status */
+	u32 mask;		/* COR/UNCOR Error Mask */
 	struct aer_header_log_regs tlp;	/* TLP Header */
 };
 
Signature · 1 line
2.25.1
#4 lore raw

PATCH v3 3/8 PCI/DPC: Initialize info->id in dpc_process_error()

In reply to Naveen Naidu

In the dpc_process_error() path, info->id isn't initialized before being passed to aer_print_error(). In the corresponding AER path, it is initialized in aer_isr_one_error().

The error message shown during Coverity Scan is:

Coverity #1461602
CID 1461602 (#1 of 1): Uninitialized scalar variable (UNINIT)
8. uninit_use_in_call: Using uninitialized value info.id when calling aer_print_error.

Initialize the "info->id" before passing it to aer_print_error()

Fixes 8aefa9b0d910 ("PCI/DPC: Print AER status in DPC event handling")
---
 drivers/pci/pcie/dpc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/pci/pcie/dpc.c +3 -3
index c556e7beafe3..df3f3a10f8bc 100644
@@ -262,14 +262,14 @@ static int dpc_get_aer_uncorrect_severity(struct pci_dev *dev,
 
 void dpc_process_error(struct pci_dev *pdev)
 {
-	u16 cap = pdev->dpc_cap, status, source, reason, ext_reason;
+	u16 cap = pdev->dpc_cap, status, reason, ext_reason;
 	struct aer_err_info info;
 
 	pci_read_config_word(pdev, cap + PCI_EXP_DPC_STATUS, &status);
-	pci_read_config_word(pdev, cap + PCI_EXP_DPC_SOURCE_ID, &source);
+	pci_read_config_word(pdev, cap + PCI_EXP_DPC_SOURCE_ID, &info.id);
 
 	pci_info(pdev, "containment event, status:%#06x source:%#06x\n",
-		 status, source);
+		 status, info.id);
 
 	reason = (status & PCI_EXP_DPC_STATUS_TRIGGER_RSN) >> 1;
 	ext_reason = (status & PCI_EXP_DPC_STATUS_TRIGGER_RSN_EXT) >> 5;
Signature · 6 lines
2.25.1

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
#5 lore raw

PATCH v3 4/8 PCI/DPC: Use pci_aer_clear_status() in dpc_process_error()

In reply to Naveen Naidu

dpc_process_error() clears both AER fatal and non fatal status registers. Instead of clearing each status registers via a different function call use pci_aer_clear_status().

This helps clean up the code a bit.

---
 drivers/pci/pcie/dpc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pci/pcie/dpc.c +1 -2
index df3f3a10f8bc..faf4a1e77fab 100644
@@ -288,8 +288,7 @@ void dpc_process_error(struct pci_dev *pdev)
 		 dpc_get_aer_uncorrect_severity(pdev, &info) &&
 		 aer_get_device_error_info(pdev, &info)) {
 		aer_print_error(pdev, &info);
-		pci_aer_clear_nonfatal_status(pdev);
-		pci_aer_clear_fatal_status(pdev);
+		pci_aer_clear_status(pdev);
 	}
 }
 
Signature · 6 lines
2.25.1

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
#6 lore raw

PATCH v3 5/8 PCI/DPC: Converge EDR and DPC Path of clearing AER registers

In reply to Naveen Naidu

In the EDR path, AER registers are cleared *after* DPC error event is processed. The process stack in EDR is:

edr_handle_event()
dpc_process_error()
pci_aer_raw_clear_status()
pcie_do_recovery()

But in DPC path, AER status registers are cleared *while* processing the error. The process stack in DPC is:

dpc_handler()
dpc_process_error()
pci_aer_clear_status()
pcie_do_recovery()

In EDR path, AER status registers are cleared irrespective of whether the error was an RP PIO or unmasked uncorrectable error. But in DPC, the AER status registers are cleared only when it's an unmasked uncorrectable error.

This leads to two different behaviours for the same task (handling of DPC errors) in FFS systems and when native OS has control.

Bring the same semantics for clearing the AER status register in EDR path and DPC path.

---
 drivers/pci/pcie/dpc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/pcie/dpc.c +1 -1
index faf4a1e77fab..68899a3db126 100644
@@ -288,7 +288,6 @@ void dpc_process_error(struct pci_dev *pdev)
 		 dpc_get_aer_uncorrect_severity(pdev, &info) &&
 		 aer_get_device_error_info(pdev, &info)) {
 		aer_print_error(pdev, &info);
-		pci_aer_clear_status(pdev);
 	}
 }
 
@@ -297,6 +296,7 @@ static irqreturn_t dpc_handler(int irq, void *context)
 	struct pci_dev *pdev = context;
 
 	dpc_process_error(pdev);
+	pci_aer_clear_status(pdev);
 
 	/* We configure DPC so it only triggers on ERR_FATAL */
 	pcie_do_recovery(pdev, pci_channel_io_frozen, dpc_reset_link);
Signature · 1 line
2.25.1
#7 lore raw

PATCH v3 6/8 PCI/AER: Clear error device AER registers in aer_irq()

In reply to Naveen Naidu

Converge the APEI path and native AER path of clearing the AER registers of the error device.

In APEI path, the system firmware clears the AER registers before handing off the record to OS. But in "native AER" path, the execution path of clearing the AER register is as follows:

aer_isr_one_error
aer_print_port_info
if (find_source_device())
aer_process_err_devices
handle_error_source
pci_write_config_dword(dev, PCI_ERR_COR_STATUS, ...)

The above path has a bug, if the find_source_device() fails, AER registers are not cleared from the error device. This means, the error device will keep reporting the error again and again and would lead to message spew.

Related Bug Report:
https://lore.kernel.org/linux-pci/20151229155822.GA17321@localhost/
https://bugzilla.kernel.org/show_bug.cgi?id=109691
https://bugzilla.kernel.org/show_bug.cgi?id=109691
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1521173

The above bug could be avoided, if the AER registers are cleared during the AER IRQ handler aer_irq(), which would provide guarantee that the AER error registers are always cleared. This is similar to how APEI handles these errors.

The main aim is that:

When an interrupt handler deals with a interrupt, it must *always* clear the source of the interrupt.

---
 drivers/pci/pci.h      |  13 ++-
 drivers/pci/pcie/aer.c | 245 ++++++++++++++++++++++++++++-------------
 2 files changed, 182 insertions(+), 76 deletions(-)
drivers/pci/pci.h +12 -1
index 9be7a966fda7..eb88d8bfeaf7 100644
@@ -424,7 +424,6 @@ static inline bool pci_dev_is_added(const struct pci_dev *dev)
 #define AER_MAX_MULTI_ERR_DEVICES	5	/* Not likely to have more */
 
 struct aer_err_info {
-	struct pci_dev *dev[AER_MAX_MULTI_ERR_DEVICES];
 	int error_dev_num;
 
 	u16	id;
@@ -440,6 +439,18 @@ struct aer_err_info {
 	struct aer_header_log_regs tlp;	/* TLP Header */
 };
 
+/* Preliminary AER error information processed from Root port */
+struct aer_devices_err_info {
+	struct pci_dev *dev[AER_MAX_MULTI_ERR_DEVICES];
+	struct aer_err_info err_info;
+};
+
+/* AER information associated with each error device */
+struct aer_dev_err_info {
+	struct pci_dev *dev;
+	struct aer_err_info err_info;
+};
+
 int aer_get_device_error_info(struct pci_dev *dev, struct aer_err_info *info);
 void aer_print_error(struct pci_dev *dev, struct aer_err_info *info);
 #endif	/* CONFIG_PCIEAER */
drivers/pci/pcie/aer.c +170 -75

359 lines not on this page · raw message

Signature · 1 line
2.25.1
#10 lore raw

PATCH v3 7/8 PCI/ERR: Remove redundant clearing of AER register in pcie_do_recovery()

In reply to Naveen Naidu

pcie_do_recovery() is shared across the following paths:
- ACPI APEI
- Native AER path
- EDR
- DPC

ACPI APEI
==========

ghes_handle_aer()
aer_recover_queue()
kfifo_in_spinlocked(aer_recover_ring)

aer_recover_work_func()
while (kfifo_get(aer_recover_ring))
pcie_do_recovery()

In this path the system firmware clears the AER registers before handing off the record to the OS in ghes_handle_aer()

Native AER
==========

aer_irq()
aer_add_err_devices_to_queue()
kfifo_put(&rpc->aer_fifo, *e_dev)
clear_error_source_aer_registers() <---- AER registers are cleard

aer_isr()
aer_isr_one_error()
handle_error_source()
pcie_do_recovery()

The AER registers are cleared during the handling of IRQ, i.e before we the recovery starts.

DPC
=====

dpc_handler()
dpc_process_error()
pci_aer_clear_status() <---- AER registers are cleared
pcie_do_recovery()

EDR
====

edr_handle_event()
dpc_process_error()
pci_aer_raw_clear_status() <---- AER registers are cleared pcie_do_recovery()

In all the above paths, the AER registers are cleared before pcie_do_recovery(). The non fatal status AER registers are again cleared in pcie_do_recovery(). This is redundant.

Remove redundant clearing of AER register in pcie_do_recovery()

---
 drivers/pci/pcie/err.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/pci/pcie/err.c +3 -6
index b576aa890c76..fe04b0ae22f4 100644
@@ -231,14 +231,11 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev,
 
 	/*
 	 * If we have native control of AER, clear error status in the device
-	 * that detected the error.  If the platform retained control of AER,
-	 * it is responsible for clearing this status.  In that case, the
-	 * signaling device may not even be visible to the OS.
+	 * that detected the error.
 	 */
-	if (host->native_aer || pcie_ports_native) {
+	if (host->native_aer || pcie_ports_native)
 		pcie_clear_device_status(dev);
-		pci_aer_clear_nonfatal_status(dev);
-	}
+
 	pci_info(bridge, "device recovery successful\n");
 	return status;
 
Signature · 1 line
2.25.1
#11 lore raw

PATCH v3 8/8 PCI/AER: Include DEVCTL in aer_print_error()

In reply to Naveen Naidu

Print the contents of Device Control Register of the device which detected the error. This might help in faster error diagnosis.

Sample output from dummy error injected by aer-inject:

pcieport 0000:00:03.0: AER: Corrected error received: 0000:00:03.0
pcieport 0000:00:03.0: PCIe Bus Error: severity=Corrected, type=Data Link Layer, (Receiver)
pcieport 0000:00:03.0: device [1b36:000c] error status/mask=00000040/0000e000, devctl=0x000f
pcieport 0000:00:03.0: [ 6] BadTLP

---
 drivers/pci/pci.h      |  2 ++
 drivers/pci/pcie/aer.c | 10 ++++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)
drivers/pci/pci.h +2 -0
index eb88d8bfeaf7..48ed7f91113b 100644
@@ -437,6 +437,8 @@ struct aer_err_info {
 	u32 status;		/* COR/UNCOR Error Status */
 	u32 mask;		/* COR/UNCOR Error Mask */
 	struct aer_header_log_regs tlp;	/* TLP Header */
+
+	u16 devctl;
 };
 
 /* Preliminary AER error information processed from Root port */
drivers/pci/pcie/aer.c +8 -2
index 91f91d6ab052..42cae01b6887 100644
@@ -729,8 +729,8 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info)
 		   aer_error_severity_string[info->severity],
 		   aer_error_layer[layer], aer_agent_string[agent]);
 
-	pci_printk(level, dev, "  device [%04x:%04x] error status/mask=%08x/%08x\n",
-		   dev->vendor, dev->device, info->status, info->mask);
+	pci_printk(level, dev, "  device [%04x:%04x] error status/mask=%08x/%08x, devctl=%#06x\n",
+		   dev->vendor, dev->device, info->status, info->mask, info->devctl);
 
 	__aer_print_error(dev, info);
 
@@ -1083,6 +1083,12 @@ int aer_get_device_error_info(struct pci_dev *dev, struct aer_err_info *info)
 	if (!aer)
 		return 0;
 
+	/*
+	 * Cache the value of Device Control Register now, because later the
+	 * device might not be available
+	 */
+	pcie_capability_read_word(dev, PCI_EXP_DEVCTL, &info->devctl);
+
 	if (info->severity == AER_CORRECTABLE) {
 		pci_read_config_dword(dev, aer + PCI_ERR_COR_STATUS,
 			&info->status);
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH v3 1/8] PCI/AER: Remove ID from aer_agent_string[]

In reply to Naveen Naidu
Quoted 12 lines · Naveen Naidu

Before 010caed4ccb6 ("PCI/AER: Decode Error Source RequesterID") the AER error logs looked like:

pcieport 0000:00:03.0: AER: Corrected error received: id=0018
pcieport 0000:00:03.0: PCIe Bus Error: severity=Corrected, type=Data Link Layer, id=0018 (Receiver ID)
pcieport 0000:00:03.0: device [1b36:000c] error status/mask=00000040/0000e000
pcieport 0000:00:03.0: [ 6] BadTLP

In 010caed4ccb6 ("PCI/AER: Decode Error Source Requester ID"), the "id" field was removed from the AER error logs, so currently AER logs look like:

Quoted 8 lines

pcieport 0000:00:03.0: AER: Corrected error received: 0000:00:03:0
pcieport 0000:00:03.0: PCIe Bus Error: severity=Corrected, type=Data Link Layer, (Receiver ID)
pcieport 0000:00:03.0: device [1b36:000c] error status/mask=00000040/0000e000
pcieport 0000:00:03.0: [ 6] BadTLP

The second line in the above logs prints "(Receiver ID)", even when there is no "id" in the log line. This is confusing.

Starting your commit log to say that message are confusing and then talk about why will make it easier to understand why the change is needed.

Quoted 8 lines

Remove the "ID" from the aer_agent_string[]. The error logs will look as follows (Sample from dummy error injected by aer-inject):

pcieport 0000:00:03.0: AER: Corrected error received: 0000:00:03.0
pcieport 0000:00:03.0: PCIe Bus Error: severity=Corrected, type=Data Link Layer, (Receiver)
pcieport 0000:00:03.0: device [1b36:000c] error status/mask=00000040/0000e000
pcieport 0000:00:03.0: [ 6] BadTLP

It is good to see before and after messages. However, it will be helpful to know why this change is necessary. It isn't very clear why in this commit log.

Quoted 2 lines

Extra signed-off-by?

Quoted 25 lines
---
  drivers/pci/pcie/aer.c | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)
drivers/pci/pcie/aer.c +4 -4
index 9784fdcf3006..241ff361b43c 100644
@@ -516,10 +516,10 @@ static const char *aer_uncorrectable_error_string[] = {
  };
 
  static const char *aer_agent_string[] = {
-	"Receiver ID",
-	"Requester ID",
-	"Completer ID",
-	"Transmitter ID"
+	"Receiver",
+	"Requester",
+	"Completer",
+	"Transmitter"
  };
 
  #define aer_stats_dev_attr(name, stats_array, strings_array,		\

drivers/pci/pcie/aer.c void aer_print_error(struct pci_dev *dev, struct aer_err_info *info) · line 709

Quoted 8 lines
drivers/pci/pcie/aer.c +1 -1
@@ -703,7 +703,7 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info)
  	const char *level;
 
  	if (!info->status) {
-		pci_err(dev, "PCIe Bus Error: severity=%s, type=Inaccessible, (Unregistered Agent ID)\n",
+		pci_err(dev, "PCIe Bus Error: severity=%s, type=Inaccessible, (Unregistered Agent)\n",
  			aer_error_severity_string[info->severity]);
  		goto out;
  	}

thanks,
-- Shuah

#8 lore raw

Re: [PATCH v3 6/8] PCI/AER: Clear error device AER registers in aer_irq()

In reply to Naveen Naidu
Thank you for the patch! Perhaps something to improve:

Hi Naveen,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on helgaas-pci/next]
[also build test WARNING on linux/master linus/master v5.15-rc3 next-20210922] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Naveen-Naidu/Fix-long-standing-AER-Error-Handling-Issues/20211004-223758
base:   https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-gcc (GCC) 11.2.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/ab727f8771a49bb5f4c7bbf10dc9ba9b90a454cf
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Naveen-Naidu/Fix-long-standing-AER-Error-Handling-Issues/20211004-223758
git checkout ab727f8771a49bb5f4c7bbf10dc9ba9b90a454cf
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash drivers/pci/pcie/ drivers/usb/dwc3/

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>):

drivers/pci/pcie/aer.c:822: warning: Function parameter or member 'e_dev' not described in 'add_error_device' drivers/pci/pcie/aer.c:822: warning: Excess function parameter 'e_info' description in 'add_error_device' drivers/pci/pcie/aer.c:923: warning: Function parameter or member 'e_dev' not described in 'find_source_device' drivers/pci/pcie/aer.c:923: warning: Excess function parameter 'e_info' description in 'find_source_device'

>> drivers/pci/pcie/aer.c:1172: warning: expecting prototype for aer_find_corr_error_source_device(). Prototype was for aer_find_uncorr_error_source_device() instead

vim +1172 drivers/pci/pcie/aer.c

1156
1157 /**
1158 * aer_find_corr_error_source_device - find the error source which detected the uncorrected error
1159 * @rp: pointer to Root Port pci_dev data structure
1160 * @e_src: pointer to an error source
1161 * @e_info: including detailed error information such like id
1162 *
1163 * Return true if found.
1164 *
1165 * Process the error information received at the Root Port, set these values
1166 * in the aer_devices_err_info and find all the devices that are related to
1167 * the error.
1168 */
1169 static bool aer_find_uncorr_error_source_device(struct pci_dev *rp,
1170 struct aer_err_source *e_src,
1171 struct aer_devices_err_info *e_info)

> 1172	{

1173 if (e_src->status & PCI_ERR_ROOT_UNCOR_RCV) {
1174 e_info->err_info.id = ERR_UNCOR_ID(e_src->id);
1175
1176 if (e_src->status & PCI_ERR_ROOT_FATAL_RCV)
1177 e_info->err_info.severity = AER_FATAL;
1178 else
1179 e_info->err_info.severity = AER_NONFATAL;
1180
1181 if (e_src->status & PCI_ERR_ROOT_MULTI_UNCOR_RCV)
1182 e_info->err_info.multi_error_valid = 1;
1183 else
1184 e_info->err_info.multi_error_valid = 0;
1185
1186 if (!find_source_device(rp, e_info))
1187 return false;
1188 }
1189
1190 return true;
1191 }
1192

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

#9 lore raw

Re: [PATCH v3 6/8] PCI/AER: Clear error device AER registers in aer_irq()

In reply to Naveen Naidu
Thank you for the patch! Perhaps something to improve:

Hi Naveen,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on helgaas-pci/next]
[also build test WARNING on linux/master linus/master v5.15-rc3 next-20210921] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Naveen-Naidu/Fix-long-standing-AER-Error-Handling-Issues/20211004-223758
base:   https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next
config: x86_64-randconfig-a006-20211004 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c0039de2953d15815448b4b3c3bafb45607781e0)

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/ab727f8771a49bb5f4c7bbf10dc9ba9b90a454cf
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Naveen-Naidu/Fix-long-standing-AER-Error-Handling-Issues/20211004-223758 git checkout ab727f8771a49bb5f4c7bbf10dc9ba9b90a454cf
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/pci/pcie/

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>):

drivers/pci/pcie/aer.c:822: warning: Function parameter or member 'e_dev' not described in 'add_error_device' drivers/pci/pcie/aer.c:822: warning: Excess function parameter 'e_info' description in 'add_error_device' drivers/pci/pcie/aer.c:923: warning: Function parameter or member 'e_dev' not described in 'find_source_device' drivers/pci/pcie/aer.c:923: warning: Excess function parameter 'e_info' description in 'find_source_device'

>> drivers/pci/pcie/aer.c:1172: warning: expecting prototype for aer_find_corr_error_source_device(). Prototype was for aer_find_uncorr_error_source_device() instead

vim +1172 drivers/pci/pcie/aer.c

1156
1157 /**
1158 * aer_find_corr_error_source_device - find the error source which detected the uncorrected error
1159 * @rp: pointer to Root Port pci_dev data structure
1160 * @e_src: pointer to an error source
1161 * @e_info: including detailed error information such like id
1162 *
1163 * Return true if found.
1164 *
1165 * Process the error information received at the Root Port, set these values
1166 * in the aer_devices_err_info and find all the devices that are related to
1167 * the error.
1168 */
1169 static bool aer_find_uncorr_error_source_device(struct pci_dev *rp,
1170 struct aer_err_source *e_src,
1171 struct aer_devices_err_info *e_info)

> 1172	{

1173 if (e_src->status & PCI_ERR_ROOT_UNCOR_RCV) {
1174 e_info->err_info.id = ERR_UNCOR_ID(e_src->id);
1175
1176 if (e_src->status & PCI_ERR_ROOT_FATAL_RCV)
1177 e_info->err_info.severity = AER_FATAL;
1178 else
1179 e_info->err_info.severity = AER_NONFATAL;
1180
1181 if (e_src->status & PCI_ERR_ROOT_MULTI_UNCOR_RCV)
1182 e_info->err_info.multi_error_valid = 1;
1183 else
1184 e_info->err_info.multi_error_valid = 0;
1185
1186 if (!find_source_device(rp, e_info))
1187 return false;
1188 }
1189
1190 return true;
1191 }
1192

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org