Commit c3900329 authored by Bjorn Helgaas's avatar Bjorn Helgaas

Merge branch 'pci/error'

- Clear AER status of the reporting device (Keith Busch)

- Clear AER status from Root Port when resetting Downstream Port (Keith
  Busch)

- Retain status from error notification (Keith Busch)

- Log the type of Port that was reset for error handling (Keith Busch)

- Report reset for frozen channel (Keith Busch)

* pci/error:
  PCI/portdrv: Report reset for frozen channel
  PCI/AER: Specify the type of Port that was reset
  PCI/ERR: Retain status from error notification
  PCI/AER: Clear AER status from Root Port when resetting Downstream Port
  PCI/ERR: Clear status of the reporting device
parents ce3e292e ba952824
...@@ -1388,7 +1388,7 @@ static pci_ers_result_t aer_root_reset(struct pci_dev *dev) ...@@ -1388,7 +1388,7 @@ static pci_ers_result_t aer_root_reset(struct pci_dev *dev)
if (type == PCI_EXP_TYPE_RC_END) if (type == PCI_EXP_TYPE_RC_END)
root = dev->rcec; root = dev->rcec;
else else
root = dev; root = pcie_find_root_port(dev);
/* /*
* If the platform retained control of AER, an RCiEP may not have * If the platform retained control of AER, an RCiEP may not have
...@@ -1414,7 +1414,8 @@ static pci_ers_result_t aer_root_reset(struct pci_dev *dev) ...@@ -1414,7 +1414,8 @@ static pci_ers_result_t aer_root_reset(struct pci_dev *dev)
} }
} else { } else {
rc = pci_bus_error_reset(dev); rc = pci_bus_error_reset(dev);
pci_info(dev, "Root Port link has been reset (%d)\n", rc); pci_info(dev, "%s Port link has been reset (%d)\n",
pci_is_root_bus(dev->bus) ? "Root" : "Downstream", rc);
} }
if ((host->native_aer || pcie_ports_native) && aer) { if ((host->native_aer || pcie_ports_native) && aer) {
......
...@@ -198,8 +198,7 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev, ...@@ -198,8 +198,7 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev,
pci_dbg(bridge, "broadcast error_detected message\n"); pci_dbg(bridge, "broadcast error_detected message\n");
if (state == pci_channel_io_frozen) { if (state == pci_channel_io_frozen) {
pci_walk_bridge(bridge, report_frozen_detected, &status); pci_walk_bridge(bridge, report_frozen_detected, &status);
status = reset_subordinates(bridge); if (reset_subordinates(bridge) != PCI_ERS_RESULT_RECOVERED) {
if (status != PCI_ERS_RESULT_RECOVERED) {
pci_warn(bridge, "subordinate device reset failed\n"); pci_warn(bridge, "subordinate device reset failed\n");
goto failed; goto failed;
} }
...@@ -231,15 +230,14 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev, ...@@ -231,15 +230,14 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev,
pci_walk_bridge(bridge, report_resume, &status); pci_walk_bridge(bridge, report_resume, &status);
/* /*
* If we have native control of AER, clear error status in the Root * If we have native control of AER, clear error status in the device
* Port or Downstream Port that signaled the error. If the * that detected the error. If the platform retained control of AER,
* platform retained control of AER, it is responsible for clearing * it is responsible for clearing this status. In that case, the
* this status. In that case, the signaling device may not even be * signaling device may not even be visible to the OS.
* visible to the OS.
*/ */
if (host->native_aer || pcie_ports_native) { if (host->native_aer || pcie_ports_native) {
pcie_clear_device_status(bridge); pcie_clear_device_status(dev);
pci_aer_clear_nonfatal_status(bridge); pci_aer_clear_nonfatal_status(dev);
} }
pci_info(bridge, "device recovery successful\n"); pci_info(bridge, "device recovery successful\n");
return status; return status;
......
...@@ -153,7 +153,8 @@ static void pcie_portdrv_remove(struct pci_dev *dev) ...@@ -153,7 +153,8 @@ static void pcie_portdrv_remove(struct pci_dev *dev)
static pci_ers_result_t pcie_portdrv_error_detected(struct pci_dev *dev, static pci_ers_result_t pcie_portdrv_error_detected(struct pci_dev *dev,
pci_channel_state_t error) pci_channel_state_t error)
{ {
/* Root Port has no impact. Always recovers. */ if (error == pci_channel_io_frozen)
return PCI_ERS_RESULT_NEED_RESET;
return PCI_ERS_RESULT_CAN_RECOVER; return PCI_ERS_RESULT_CAN_RECOVER;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment