All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] PCIe AER: report uncorrectable errors only to the functions that logged the errors
@ 2017-08-18 11:02 Gabriele Paoloni
  2017-08-30  8:38   ` Gabriele Paoloni
  2017-08-31 20:03 ` Bjorn Helgaas
  0 siblings, 2 replies; 13+ messages in thread
From: Gabriele Paoloni @ 2017-08-18 11:02 UTC (permalink / raw)
  To: helgaas; +Cc: gabriele.paoloni, linuxarm, liudongdong3, linux-pci, linux-kernel

Currently if an uncorrectable error is reported by an EP the AER
driver walks over all the devices connected to the upstream port
bus and in turns call the report_error_detected() callback.
If any of the devices connected to the bus does not implement
dev->driver->err_handler->error_detected() do_recovery() will fail
leaving all the bus hierarchy devices unrecovered.

However for non fatal errors the PCIe link should not be considered
compromised, therefore it makes sense to report the error only to
all the functions that logged an error.
This patch implements this new behaviour for non fatal errors.

Signed-off-by: Gabriele Paoloni <gabriele.paoloni@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
Changes from v1:
   - now errors are reported only to the fucntions that logged the error
     instead of all the functions in the same device.
   - the patch subject has changed to match the new implementation
---
 drivers/pci/pcie/aer/aerdrv_core.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c
index b1303b3..057465ad 100644
--- a/drivers/pci/pcie/aer/aerdrv_core.c
+++ b/drivers/pci/pcie/aer/aerdrv_core.c
@@ -390,7 +390,14 @@ static pci_ers_result_t broadcast_error_message(struct pci_dev *dev,
 		 * If the error is reported by an end point, we think this
 		 * error is related to the upstream link of the end point.
 		 */
-		pci_walk_bus(dev->bus, cb, &result_data);
+		if (state == pci_channel_io_normal)
+			/*
+			 * the error is non fatal so the bus is ok, just invoke
+			 * the callback for the function that logged the error.
+			 */
+			cb(dev, &result_data);
+		else
+			pci_walk_bus(dev->bus, cb, &result_data);
 	}
 
 	return result_data.result;
-- 
2.7.4

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

end of thread, other threads:[~2017-09-27 16:02 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-18 11:02 [PATCH v2] PCIe AER: report uncorrectable errors only to the functions that logged the errors Gabriele Paoloni
2017-08-30  8:38 ` Gabriele Paoloni
2017-08-30  8:38   ` Gabriele Paoloni
2017-08-31 20:03 ` Bjorn Helgaas
2017-09-01  4:43   ` Bjorn Helgaas
2017-09-01 11:39     ` Gabriele Paoloni
2017-09-01 11:39       ` Gabriele Paoloni
2017-09-02 17:33       ` Bjorn Helgaas
2017-09-06 10:56         ` Gabriele Paoloni
2017-09-06 10:56           ` Gabriele Paoloni
2017-09-25 18:34           ` Bjorn Helgaas
2017-09-27 16:02             ` Gabriele Paoloni
2017-09-27 16:02               ` Gabriele Paoloni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.