aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-06-05 23:50:34 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-11 19:02:08 -0400
commitf0dce411930d16a678173e534594bca160f5eaff (patch)
tree52d7c4d6d4e374ac3b808f4f7a9b0ba7be729234
parent65b3bc358a3195ebe459761a248cf33a61539947 (diff)
PCI aer: add pci_cleanup_aer_correct_aer_status
Function to clear bogus correctable errors. Analog to pci_aer_uncorrect_are_status. The Marvell chips seem to start out with a bogus value that needs to be cleared. Yanmin ported it to 2.6.22-rc4 by fixing a fuzz patch applying info. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Acked-by: Zhang Yanmin <yanmin.zhang@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/pci/pcie/aer/aerdrv_core.c16
-rw-r--r--include/linux/aer.h2
2 files changed, 18 insertions, 0 deletions
diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c
index fef159a68081..92a8469b21ba 100644
--- a/drivers/pci/pcie/aer/aerdrv_core.c
+++ b/drivers/pci/pcie/aer/aerdrv_core.c
@@ -117,6 +117,21 @@ int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev)
117 return 0; 117 return 0;
118} 118}
119 119
120int pci_cleanup_aer_correct_error_status(struct pci_dev *dev)
121{
122 int pos;
123 u32 status;
124
125 pos = pci_find_aer_capability(dev);
126 if (!pos)
127 return -EIO;
128
129 pci_read_config_dword(dev, pos + PCI_ERR_COR_STATUS, &status);
130 pci_write_config_dword(dev, pos + PCI_ERR_COR_STATUS, status);
131
132 return 0;
133}
134
120static int find_device_iter(struct device *device, void *data) 135static int find_device_iter(struct device *device, void *data)
121{ 136{
122 struct pci_dev *dev; 137 struct pci_dev *dev;
@@ -741,4 +756,5 @@ EXPORT_SYMBOL_GPL(pci_find_aer_capability);
741EXPORT_SYMBOL_GPL(pci_enable_pcie_error_reporting); 756EXPORT_SYMBOL_GPL(pci_enable_pcie_error_reporting);
742EXPORT_SYMBOL_GPL(pci_disable_pcie_error_reporting); 757EXPORT_SYMBOL_GPL(pci_disable_pcie_error_reporting);
743EXPORT_SYMBOL_GPL(pci_cleanup_aer_uncorrect_error_status); 758EXPORT_SYMBOL_GPL(pci_cleanup_aer_uncorrect_error_status);
759EXPORT_SYMBOL_GPL(pci_cleanup_aer_correct_error_status);
744 760
diff --git a/include/linux/aer.h b/include/linux/aer.h
index 64aacaed8d6c..509656286e53 100644
--- a/include/linux/aer.h
+++ b/include/linux/aer.h
@@ -13,11 +13,13 @@ extern int pci_enable_pcie_error_reporting(struct pci_dev *dev);
13extern int pci_find_aer_capability(struct pci_dev *dev); 13extern int pci_find_aer_capability(struct pci_dev *dev);
14extern int pci_disable_pcie_error_reporting(struct pci_dev *dev); 14extern int pci_disable_pcie_error_reporting(struct pci_dev *dev);
15extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev); 15extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev);
16extern int pci_cleanup_aer_correct_error_status(struct pci_dev *dev);
16#else 17#else
17#define pci_enable_pcie_error_reporting(dev) (-EINVAL) 18#define pci_enable_pcie_error_reporting(dev) (-EINVAL)
18#define pci_find_aer_capability(dev) (0) 19#define pci_find_aer_capability(dev) (0)
19#define pci_disable_pcie_error_reporting(dev) (-EINVAL) 20#define pci_disable_pcie_error_reporting(dev) (-EINVAL)
20#define pci_cleanup_aer_uncorrect_error_status(dev) (-EINVAL) 21#define pci_cleanup_aer_uncorrect_error_status(dev) (-EINVAL)
22#define pci_cleanup_aer_correct_error_status(dev) (-EINVAL)
21#endif 23#endif
22 24
23#endif //_AER_H_ 25#endif //_AER_H_