diff options
Diffstat (limited to 'drivers/pci/pcie')
-rw-r--r-- | drivers/pci/pcie/aer/aerdrv.h | 4 | ||||
-rw-r--r-- | drivers/pci/pcie/aer/aerdrv_core.c | 28 | ||||
-rw-r--r-- | drivers/pci/pcie/aer/aerdrv_errprint.c | 6 |
3 files changed, 17 insertions, 21 deletions
diff --git a/drivers/pci/pcie/aer/aerdrv.h b/drivers/pci/pcie/aer/aerdrv.h index 820ea73d25f7..0db530db9439 100644 --- a/drivers/pci/pcie/aer/aerdrv.h +++ b/drivers/pci/pcie/aer/aerdrv.h | |||
@@ -47,9 +47,6 @@ | |||
47 | #define AER_TLP_HEADER_VALID_FLAG 0x00000001 | 47 | #define AER_TLP_HEADER_VALID_FLAG 0x00000001 |
48 | #define AER_MULTI_ERROR_VALID_FLAG 0x00000002 | 48 | #define AER_MULTI_ERROR_VALID_FLAG 0x00000002 |
49 | 49 | ||
50 | #define ERR_CORRECTABLE_ERROR_MASK 0x000031c1 | ||
51 | #define ERR_UNCORRECTABLE_ERROR_MASK 0x001ff010 | ||
52 | |||
53 | struct header_log_regs { | 50 | struct header_log_regs { |
54 | unsigned int dw0; | 51 | unsigned int dw0; |
55 | unsigned int dw1; | 52 | unsigned int dw1; |
@@ -65,6 +62,7 @@ struct aer_err_info { | |||
65 | int severity; /* 0:NONFATAL | 1:FATAL | 2:COR */ | 62 | int severity; /* 0:NONFATAL | 1:FATAL | 2:COR */ |
66 | int flags; | 63 | int flags; |
67 | unsigned int status; /* COR/UNCOR Error Status */ | 64 | unsigned int status; /* COR/UNCOR Error Status */ |
65 | unsigned int mask; /* COR/UNCOR Error Mask */ | ||
68 | struct header_log_regs tlp; /* TLP Header */ | 66 | struct header_log_regs tlp; /* TLP Header */ |
69 | }; | 67 | }; |
70 | 68 | ||
diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c index 4d67db8dd0d0..38b3933200ca 100644 --- a/drivers/pci/pcie/aer/aerdrv_core.c +++ b/drivers/pci/pcie/aer/aerdrv_core.c | |||
@@ -236,24 +236,16 @@ static int find_device_iter(struct pci_dev *dev, void *data) | |||
236 | status = 0; | 236 | status = 0; |
237 | mask = 0; | 237 | mask = 0; |
238 | if (e_info->severity == AER_CORRECTABLE) { | 238 | if (e_info->severity == AER_CORRECTABLE) { |
239 | pci_read_config_dword(dev, | 239 | pci_read_config_dword(dev, pos + PCI_ERR_COR_STATUS, &status); |
240 | pos + PCI_ERR_COR_STATUS, | 240 | pci_read_config_dword(dev, pos + PCI_ERR_COR_MASK, &mask); |
241 | &status); | 241 | if (status & ~mask) { |
242 | pci_read_config_dword(dev, | ||
243 | pos + PCI_ERR_COR_MASK, | ||
244 | &mask); | ||
245 | if (status & ERR_CORRECTABLE_ERROR_MASK & ~mask) { | ||
246 | add_error_device(e_info, dev); | 242 | add_error_device(e_info, dev); |
247 | goto added; | 243 | goto added; |
248 | } | 244 | } |
249 | } else { | 245 | } else { |
250 | pci_read_config_dword(dev, | 246 | pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS, &status); |
251 | pos + PCI_ERR_UNCOR_STATUS, | 247 | pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_MASK, &mask); |
252 | &status); | 248 | if (status & ~mask) { |
253 | pci_read_config_dword(dev, | ||
254 | pos + PCI_ERR_UNCOR_MASK, | ||
255 | &mask); | ||
256 | if (status & ERR_UNCORRECTABLE_ERROR_MASK & ~mask) { | ||
257 | add_error_device(e_info, dev); | 249 | add_error_device(e_info, dev); |
258 | goto added; | 250 | goto added; |
259 | } | 251 | } |
@@ -720,7 +712,9 @@ static int get_device_error_info(struct pci_dev *dev, struct aer_err_info *info) | |||
720 | if (info->severity == AER_CORRECTABLE) { | 712 | if (info->severity == AER_CORRECTABLE) { |
721 | pci_read_config_dword(dev, pos + PCI_ERR_COR_STATUS, | 713 | pci_read_config_dword(dev, pos + PCI_ERR_COR_STATUS, |
722 | &info->status); | 714 | &info->status); |
723 | if (!(info->status & ERR_CORRECTABLE_ERROR_MASK)) | 715 | pci_read_config_dword(dev, pos + PCI_ERR_COR_MASK, |
716 | &info->mask); | ||
717 | if (!(info->status & ~info->mask)) | ||
724 | return AER_UNSUCCESS; | 718 | return AER_UNSUCCESS; |
725 | } else if (dev->hdr_type & PCI_HEADER_TYPE_BRIDGE || | 719 | } else if (dev->hdr_type & PCI_HEADER_TYPE_BRIDGE || |
726 | info->severity == AER_NONFATAL) { | 720 | info->severity == AER_NONFATAL) { |
@@ -728,7 +722,9 @@ static int get_device_error_info(struct pci_dev *dev, struct aer_err_info *info) | |||
728 | /* Link is still healthy for IO reads */ | 722 | /* Link is still healthy for IO reads */ |
729 | pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS, | 723 | pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS, |
730 | &info->status); | 724 | &info->status); |
731 | if (!(info->status & ERR_UNCORRECTABLE_ERROR_MASK)) | 725 | pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_MASK, |
726 | &info->mask); | ||
727 | if (!(info->status & ~info->mask)) | ||
732 | return AER_UNSUCCESS; | 728 | return AER_UNSUCCESS; |
733 | 729 | ||
734 | if (info->status & AER_LOG_TLP_MASKS) { | 730 | if (info->status & AER_LOG_TLP_MASKS) { |
diff --git a/drivers/pci/pcie/aer/aerdrv_errprint.c b/drivers/pci/pcie/aer/aerdrv_errprint.c index 95c3f1ca8076..41bd1c753ace 100644 --- a/drivers/pci/pcie/aer/aerdrv_errprint.c +++ b/drivers/pci/pcie/aer/aerdrv_errprint.c | |||
@@ -154,11 +154,13 @@ static char *aer_agent_string[] = { | |||
154 | 154 | ||
155 | static void aer_print_error_source(struct aer_err_info *info) | 155 | static void aer_print_error_source(struct aer_err_info *info) |
156 | { | 156 | { |
157 | int i; | 157 | int i, status; |
158 | char *errmsg = NULL; | 158 | char *errmsg = NULL; |
159 | 159 | ||
160 | status = (info->status & ~info->mask); | ||
161 | |||
160 | for (i = 0; i < 32; i++) { | 162 | for (i = 0; i < 32; i++) { |
161 | if (!(info->status & (1 << i))) | 163 | if (!(status & (1 << i))) |
162 | continue; | 164 | continue; |
163 | 165 | ||
164 | if (info->severity == AER_CORRECTABLE) | 166 | if (info->severity == AER_CORRECTABLE) |