aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pcie/aer.c
diff options
context:
space:
mode:
authorOza Pawandeep <poza@codeaurora.org>2018-07-19 18:58:06 -0400
committerBjorn Helgaas <bhelgaas@google.com>2018-07-20 16:27:09 -0400
commit5b6c09660da8779dd545fa717c2b0cc79d477c9e (patch)
treeebc8d20816c9c77d0543de52293bd9b627a6b45b /drivers/pci/pcie/aer.c
parente7b0b847de6db161e3917732276e425bc92a2feb (diff)
PCI/AER: Factor out ERR_NONFATAL status bit clearing
aer_error_resume() clears all ERR_NONFATAL error status bits. This is exactly what pci_cleanup_aer_uncorrect_error_status(), so use that instead of duplicating the code. Signed-off-by: Oza Pawandeep <poza@codeaurora.org> [bhelgaas: split to separate patch] Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/pcie/aer.c')
-rw-r--r--drivers/pci/pcie/aer.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
index f853e72524be..4411ada4a91c 100644
--- a/drivers/pci/pcie/aer.c
+++ b/drivers/pci/pcie/aer.c
@@ -1532,20 +1532,13 @@ static pci_ers_result_t aer_root_reset(struct pci_dev *dev)
1532 */ 1532 */
1533static void aer_error_resume(struct pci_dev *dev) 1533static void aer_error_resume(struct pci_dev *dev)
1534{ 1534{
1535 int pos;
1536 u32 status, mask;
1537 u16 reg16; 1535 u16 reg16;
1538 1536
1539 /* Clean up Root device status */ 1537 /* Clean up Root device status */
1540 pcie_capability_read_word(dev, PCI_EXP_DEVSTA, &reg16); 1538 pcie_capability_read_word(dev, PCI_EXP_DEVSTA, &reg16);
1541 pcie_capability_write_word(dev, PCI_EXP_DEVSTA, reg16); 1539 pcie_capability_write_word(dev, PCI_EXP_DEVSTA, reg16);
1542 1540
1543 /* Clean AER Root Error Status */ 1541 pci_cleanup_aer_uncorrect_error_status(dev);
1544 pos = dev->aer_cap;
1545 pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS, &status);
1546 pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_SEVER, &mask);
1547 status &= ~mask; /* Clear corresponding nonfatal bits */
1548 pci_write_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS, status);
1549} 1542}
1550 1543
1551static struct pcie_port_service_driver aerdriver = { 1544static struct pcie_port_service_driver aerdriver = {