Skip to contentSkip to conversation

PCI: DPC: Clear AER status bits before disabling port containment

PATCH In review Alexandru Gagniuc 4 participants 5 messages May 16, 2018 – Jun 26, 2018

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

PATCH 1/1 PCI: DPC: Clear AER status bits before disabling port containment

AER status bits are sticky, and they survive system resets. Downstream devices are usually taken care of after re-enumerating the downstream busses, as the AER bits are cleared during probe().

However, nothing clears the bits of the port which contained the error. These sticky bits may leave some BIOSes to think that something bad happened, and print ominous messages on next boot. To prevent this, tidy up the AER status bits before releasing containment.

---
 drivers/pci/pcie/dpc.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/pci/pcie/dpc.c +4 -0
index 8c57d607e603..bf82d6936556 100644
@@ -112,6 +112,10 @@ static void dpc_work(struct work_struct *work)
 		dpc->rp_pio_status = 0;
 	}
 
+	/* DPC event made a mess of our AER status bits. Clean them up. */
+	pci_cleanup_aer_error_status_regs(pdev);
+	/* TODO: Should we also use aer_print_error to log the event? */
+
 	pci_write_config_word(pdev, cap + PCI_EXP_DPC_STATUS,
 		PCI_EXP_DPC_STATUS_TRIGGER | PCI_EXP_DPC_STATUS_INTERRUPT);
 
Signature · 1 line
2.14.3
#1 lore raw
Quoted 20 lines · Alexandru Gagniuc

AER status bits are sticky, and they survive system resets. Downstream devices are usually taken care of after re-enumerating the downstream busses, as the AER bits are cleared during probe().

However, nothing clears the bits of the port which contained the error. These sticky bits may leave some BIOSes to think that something bad happened, and print ominous messages on next boot. To prevent this, tidy up the AER status bits before releasing containment.

---
 drivers/pci/pcie/dpc.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/pci/pcie/dpc.c +0 -0
index 8c57d607e603..bf82d6936556 100644

drivers/pci/pcie/dpc.c static void dpc_work(struct work_struct *work) · line 121

Quoted 10 lines
drivers/pci/pcie/dpc.c +4 -0
@@ -112,6 +112,10 @@ static void dpc_work(struct work_struct *work)
 		dpc->rp_pio_status = 0;
 	}
 
+	/* DPC event made a mess of our AER status bits. Clean them up. */
+	pci_cleanup_aer_error_status_regs(pdev);
+	/* TODO: Should we also use aer_print_error to log the event? */
+
 	pci_write_config_word(pdev, cap + PCI_EXP_DPC_STATUS,
 		PCI_EXP_DPC_STATUS_TRIGGER | PCI_EXP_DPC_STATUS_INTERRUPT);
 

I think Keith has a patch to fix this. It was under review at some point.

Signature · 3 lines
Sinan Kaya
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
Quoted 23 lines · Sinan Kaya
Quoted 22 lines · Alexandru Gagniuc

AER status bits are sticky, and they survive system resets. Downstream devices are usually taken care of after re-enumerating the downstream busses, as the AER bits are cleared during probe().

However, nothing clears the bits of the port which contained the error. These sticky bits may leave some BIOSes to think that something bad happened, and print ominous messages on next boot. To prevent this, tidy up the AER status bits before releasing containment.

---
 drivers/pci/pcie/dpc.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/pci/pcie/dpc.c +0 -0
index 8c57d607e603..bf82d6936556 100644
@@ -112,6 +112,10 @@ static void dpc_work(struct work_struct *work)
 		dpc->rp_pio_status = 0;
 	}
 
Quoted 10 lines

drivers/pci/pcie/dpc.c static void dpc_work(struct work_struct *work) · line 121

Quoted 8 lines
drivers/pci/pcie/dpc.c +4 -0
+	/* DPC event made a mess of our AER status bits. Clean them up. */
+	pci_cleanup_aer_error_status_regs(pdev);
+	/* TODO: Should we also use aer_print_error to log the event? */
+
 	pci_write_config_word(pdev, cap + PCI_EXP_DPC_STATUS,
 		PCI_EXP_DPC_STATUS_TRIGGER | PCI_EXP_DPC_STATUS_INTERRUPT);
 

I think Keith has a patch to fix this. It was under review at some point.

Right, I do intend to following up on this, but I've had some trouble finding time the last few weeks. Sorry about that, things will clear up for me shortly.

#3 lore raw
Quoted 35 lines · Keith Busch
Quoted 23 lines · Sinan Kaya
Quoted 22 lines · Alexandru Gagniuc

AER status bits are sticky, and they survive system resets. Downstream devices are usually taken care of after re-enumerating the downstream busses, as the AER bits are cleared during probe().

However, nothing clears the bits of the port which contained the error. These sticky bits may leave some BIOSes to think that something bad happened, and print ominous messages on next boot. To prevent this, tidy up the AER status bits before releasing containment.

---
 drivers/pci/pcie/dpc.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/pci/pcie/dpc.c +0 -0
index 8c57d607e603..bf82d6936556 100644
@@ -112,6 +112,10 @@ static void dpc_work(struct work_struct *work)
 		dpc->rp_pio_status = 0;
 	}
 
Quoted 10 lines

drivers/pci/pcie/dpc.c static void dpc_work(struct work_struct *work) · line 121

Quoted 8 lines
drivers/pci/pcie/dpc.c +4 -0
+	/* DPC event made a mess of our AER status bits. Clean them up. */
+	pci_cleanup_aer_error_status_regs(pdev);
+	/* TODO: Should we also use aer_print_error to log the event? */
+
 	pci_write_config_word(pdev, cap + PCI_EXP_DPC_STATUS,
 		PCI_EXP_DPC_STATUS_TRIGGER | PCI_EXP_DPC_STATUS_INTERRUPT);
 

I think Keith has a patch to fix this. It was under review at some point.

Quoted 3 lines

Right, I do intend to following up on this, but I've had some trouble finding time the last few weeks. Sorry about that, things will clear up for me shortly.

I'll drop this (Alexandru's) patch for now, waiting for your update, Keith.

author
#4 lore raw
Quoted 36 lines · Bjorn Helgaas
Quoted 35 lines · Keith Busch
Quoted 33 lines · Sinan Kaya
Quoted 20 lines · Alexandru Gagniuc

AER status bits are sticky, and they survive system resets. Downstream devices are usually taken care of after re-enumerating the downstream busses, as the AER bits are cleared during probe().

However, nothing clears the bits of the port which contained the error. These sticky bits may leave some BIOSes to think that something bad happened, and print ominous messages on next boot. To prevent this, tidy up the AER status bits before releasing containment.

---
 drivers/pci/pcie/dpc.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/pci/pcie/dpc.c +0 -0
index 8c57d607e603..bf82d6936556 100644

drivers/pci/pcie/dpc.c static void dpc_work(struct work_struct *work) · line 121

Quoted 10 lines
drivers/pci/pcie/dpc.c +4 -0
@@ -112,6 +112,10 @@ static void dpc_work(struct work_struct *work)
 		dpc->rp_pio_status = 0;
 	}
 
+	/* DPC event made a mess of our AER status bits. Clean them up. */
+	pci_cleanup_aer_error_status_regs(pdev);
+	/* TODO: Should we also use aer_print_error to log the event? */
+
 	pci_write_config_word(pdev, cap + PCI_EXP_DPC_STATUS,
 		PCI_EXP_DPC_STATUS_TRIGGER | PCI_EXP_DPC_STATUS_INTERRUPT);
 

I think Keith has a patch to fix this. It was under review at some point.

Quoted 5 lines
Quoted 3 lines

Right, I do intend to following up on this, but I've had some trouble finding time the last few weeks. Sorry about that, things will clear up for me shortly.

I'll drop this (Alexandru's) patch for now, waiting for your update, Keith.

I wonder if clearing AER status bits is mutually exclusive with refactoring other parts of DPC handling?

Alex