diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2018-07-19 18:55:58 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2018-07-20 16:27:07 -0400 |
commit | 7ab92e89bf8b0a93f0d53b6d83270e4cd0f7c563 (patch) | |
tree | 42e0105464b99fea2d6311abab642d078b3c819e /drivers/pci/pcie/aer.c | |
parent | 7af02fcd84c16801958936f88b848944c726ca07 (diff) |
PCI/AER: Clear only ERR_FATAL status bits during fatal recovery
During recovery from fatal errors, we previously called
pci_cleanup_aer_uncorrect_error_status(), which cleared *all* uncorrectable
error status bits (both ERR_FATAL and ERR_NONFATAL).
Instead, call a new pci_aer_clear_fatal_status() that clears only the
ERR_FATAL bits (as indicated by the PCI_ERR_UNCOR_SEVER register).
Based-on-patch-by: Oza Pawandeep <poza@codeaurora.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/pcie/aer.c')
-rw-r--r-- | drivers/pci/pcie/aer.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index 766687094706..b776a768a434 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c | |||
@@ -399,6 +399,23 @@ int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev) | |||
399 | } | 399 | } |
400 | EXPORT_SYMBOL_GPL(pci_cleanup_aer_uncorrect_error_status); | 400 | EXPORT_SYMBOL_GPL(pci_cleanup_aer_uncorrect_error_status); |
401 | 401 | ||
402 | void pci_aer_clear_fatal_status(struct pci_dev *dev) | ||
403 | { | ||
404 | int pos; | ||
405 | u32 status, sev; | ||
406 | |||
407 | pos = dev->aer_cap; | ||
408 | if (!pos) | ||
409 | return; | ||
410 | |||
411 | /* Clear status bits for ERR_FATAL errors only */ | ||
412 | pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS, &status); | ||
413 | pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_SEVER, &sev); | ||
414 | status &= sev; | ||
415 | if (status) | ||
416 | pci_write_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS, status); | ||
417 | } | ||
418 | |||
402 | int pci_cleanup_aer_error_status_regs(struct pci_dev *dev) | 419 | int pci_cleanup_aer_error_status_regs(struct pci_dev *dev) |
403 | { | 420 | { |
404 | int pos; | 421 | int pos; |