Skip to content

Commit f04e528

Browse files
committed
Merge branch 'pci/aer'
- Log AER errors as "Correctable" (not "Corrected") or "Uncorrectable" to match spec terminology (Bjorn Helgaas) - Decode Requester ID when no error info found instead of printing the raw hex value (Bjorn Helgaas) * pci/aer: PCI/AER: Use explicit register sizes for struct members PCI/AER: Decode Requester ID when no error info found PCI/AER: Use 'Correctable' and 'Uncorrectable' spec terms for errors
2 parents b85ea95 + db02e17 commit f04e528

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

drivers/pci/pcie/aer.c

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
#define AER_MAX_TYPEOF_UNCOR_ERRS 27 /* as per PCI_ERR_UNCOR_STATUS*/
4242

4343
struct aer_err_source {
44-
unsigned int status;
45-
unsigned int id;
44+
u32 status; /* PCI_ERR_ROOT_STATUS */
45+
u32 id; /* PCI_ERR_ROOT_ERR_SRC */
4646
};
4747

4848
struct aer_rpc {
@@ -435,10 +435,10 @@ void pci_aer_exit(struct pci_dev *dev)
435435
/*
436436
* AER error strings
437437
*/
438-
static const char *aer_error_severity_string[] = {
439-
"Uncorrected (Non-Fatal)",
440-
"Uncorrected (Fatal)",
441-
"Corrected"
438+
static const char * const aer_error_severity_string[] = {
439+
"Uncorrectable (Non-Fatal)",
440+
"Uncorrectable (Fatal)",
441+
"Correctable"
442442
};
443443

444444
static const char *aer_error_layer[] = {
@@ -740,7 +740,7 @@ static void aer_print_port_info(struct pci_dev *dev, struct aer_err_info *info)
740740
u8 bus = info->id >> 8;
741741
u8 devfn = info->id & 0xff;
742742

743-
pci_info(dev, "%s%s error received: %04x:%02x:%02x.%d\n",
743+
pci_info(dev, "%s%s error message received from %04x:%02x:%02x.%d\n",
744744
info->multi_error_valid ? "Multiple " : "",
745745
aer_error_severity_string[info->severity],
746746
pci_domain_nr(dev->bus), bus, PCI_SLOT(devfn),
@@ -929,7 +929,12 @@ static bool find_source_device(struct pci_dev *parent,
929929
pci_walk_bus(parent->subordinate, find_device_iter, e_info);
930930

931931
if (!e_info->error_dev_num) {
932-
pci_info(parent, "can't find device of ID%04x\n", e_info->id);
932+
u8 bus = e_info->id >> 8;
933+
u8 devfn = e_info->id & 0xff;
934+
935+
pci_info(parent, "found no error details for %04x:%02x:%02x.%d\n",
936+
pci_domain_nr(parent->bus), bus, PCI_SLOT(devfn),
937+
PCI_FUNC(devfn));
933938
return false;
934939
}
935940
return true;

include/linux/aer.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
struct pci_dev;
2020

2121
struct aer_header_log_regs {
22-
unsigned int dw0;
23-
unsigned int dw1;
24-
unsigned int dw2;
25-
unsigned int dw3;
22+
u32 dw0;
23+
u32 dw1;
24+
u32 dw2;
25+
u32 dw3;
2626
};
2727

2828
struct aer_capability_regs {

0 commit comments

Comments
 (0)