[PATCHv2 4/6] PCI/DPC: Print AER status in DPC event handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



A DPC enabled device suppresses ERR_(NON)FATAL messages, preventing the
AER handler from reporting error details. If the DPC trigger reason says
the downstream port detected the error, this patch has the DPC driver
collect the AER uncorrectable status for logging, then clears the status.

Signed-off-by: Keith Busch <keith.busch@xxxxxxxxx>
---
 drivers/pci/pcie/pcie-dpc.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/pci/pcie/pcie-dpc.c b/drivers/pci/pcie/pcie-dpc.c
index d1fbd83cd240..85350b00f251 100644
--- a/drivers/pci/pcie/pcie-dpc.c
+++ b/drivers/pci/pcie/pcie-dpc.c
@@ -44,6 +44,7 @@ struct dpc_dev {
 	int			cap_pos;
 	bool			rp;
 	u32			rp_pio_status;
+	struct aer_err_info	info;
 };
 
 static const char * const rp_pio_error_string[] = {
@@ -112,6 +113,12 @@ static void interrupt_event_handler(struct work_struct *work)
 	struct pci_bus *parent = pdev->subordinate;
 	u16 ctl;
 
+	if (dpc->info.severity == AER_NONFATAL) {
+		if (aer_get_device_error_info(pdev, &dpc->info)) {
+			aer_print_error(pdev, &dpc->info);
+			pci_cleanup_aer_uncorrect_error_status(pdev);
+		}
+	}
 	pci_lock_rescan_remove();
 	list_for_each_entry_safe_reverse(dev, temp, &parent->devices,
 					 bus_list) {
@@ -298,6 +305,11 @@ static irqreturn_t dpc_irq(int irq, void *context)
 
 	schedule_work(&dpc->work);
 
+	if (reason == 0)
+		dpc->info.severity = AER_NONFATAL;
+	else
+		dpc->info.severity = AER_CORRECTABLE;
+
 	return IRQ_HANDLED;
 }
 
-- 
2.13.6




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux