@@ -535,33 +535,6 @@ failed:
}
/**
- * handle_error_source - handle logging error into an event log
- * @aerdev: pointer to pcie_device data structure of the root port
- * @dev: pointer to pci_dev data structure of error source device
- * @info: comprehensive error information
- *
- * Invoked when an error being detected by Root Port.
- */
-static void handle_error_source(struct pcie_device *aerdev,
- struct pci_dev *dev,
- struct aer_err_info *info)
-{
- int pos;
-
- if (info->severity == AER_CORRECTABLE) {
- /*
- * Correctable error does not need software intevention.
- * No need to go through error recovery process.
- */
- pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);
- if (pos)
- pci_write_config_dword(dev, pos + PCI_ERR_COR_STATUS,
- info->status);
- } else
- do_recovery(aerdev, dev, info->severity);
-}
-
-/**
* aer_enable_rootport - enable Root Port's interrupts when receiving messages
* @rpc: pointer to a Root Port data structure
*
@@ -661,6 +634,9 @@ static int get_device_error_info(struct pci_dev *dev, struct aer_err_info *info)
&info->mask);
if (!(info->status & ~info->mask))
return 0;
+ /* Clear correctable error status immediately */
+ pci_write_config_dword(dev, pos + PCI_ERR_COR_STATUS,
+ info->status);
} else if (dev->hdr_type & PCI_HEADER_TYPE_BRIDGE ||
info->severity == AER_NONFATAL) {
@@ -702,9 +678,17 @@ static inline void aer_process_err_devices(struct pcie_device *p_device,
if (get_device_error_info(e_info->dev[i], e_info))
aer_print_error(e_info->dev[i], e_info);
}
+
+ /*
+ * Correctable error does not need software intervention.
+ * No need to go through error recovery process.
+ */
+ if (e_info->severity == AER_CORRECTABLE)
+ return;
+
for (i = 0; i < e_info->error_dev_num && e_info->dev[i]; i++) {
if (get_device_error_info(e_info->dev[i], e_info))
- handle_error_source(p_device, e_info->dev[i], e_info);
+ do_recovery(p_device, e_info->dev[i], e_info->severity);
}
}