Skip to content

Commit 6a1eda7

Browse files
committed
PCI/AER: Consolidate Error Source ID logging in aer_isr_one_error_type()
Previously we decoded the AER Error Source ID in aer_isr_one_error_type(), then again in find_source_device() if we didn't find any devices with errors logged in their AER Capabilities. Consolidate this so we only decode and log the Error Source ID once in aer_isr_one_error_type(). Add a "found" parameter so we can add a note when we didn't find any downstream devices with errors logged in their AER Capability. This changes the dmesg logging when we found no devices with errors logged: - pci 0000:00:01.0: AER: Correctable error message received from 0000:02:00.0 - pci 0000:00:01.0: AER: found no error details for 0000:02:00.0 + pci 0000:00:01.0: AER: Correctable error message received from 0000:02:00.0 (no details found) Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Reviewed-by: Kuppuswamy Sathyanarayanan <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 6fc4dae commit 6a1eda7

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

drivers/pci/pcie/aer.c

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -733,16 +733,17 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info)
733733
info->severity, info->tlp_header_valid, &info->tlp);
734734
}
735735

736-
static void aer_print_port_info(struct pci_dev *dev, struct aer_err_info *info)
736+
static void aer_print_port_info(struct pci_dev *dev, struct aer_err_info *info,
737+
bool found)
737738
{
738739
u8 bus = info->id >> 8;
739740
u8 devfn = info->id & 0xff;
740741

741-
pci_info(dev, "%s%s error message received from %04x:%02x:%02x.%d\n",
742+
pci_info(dev, "%s%s error message received from %04x:%02x:%02x.%d%s\n",
742743
info->multi_error_valid ? "Multiple " : "",
743744
aer_error_severity_string[info->severity],
744745
pci_domain_nr(dev->bus), bus, PCI_SLOT(devfn),
745-
PCI_FUNC(devfn));
746+
PCI_FUNC(devfn), found ? "" : " (no details found");
746747
}
747748

748749
#ifdef CONFIG_ACPI_APEI_PCIEAER
@@ -926,15 +927,8 @@ static bool find_source_device(struct pci_dev *parent,
926927
else
927928
pci_walk_bus(parent->subordinate, find_device_iter, e_info);
928929

929-
if (!e_info->error_dev_num) {
930-
u8 bus = e_info->id >> 8;
931-
u8 devfn = e_info->id & 0xff;
932-
933-
pci_info(parent, "found no error details for %04x:%02x:%02x.%d\n",
934-
pci_domain_nr(parent->bus), bus, PCI_SLOT(devfn),
935-
PCI_FUNC(devfn));
930+
if (!e_info->error_dev_num)
936931
return false;
937-
}
938932
return true;
939933
}
940934

@@ -1281,9 +1275,11 @@ static inline void aer_process_err_devices(struct aer_err_info *e_info)
12811275
static void aer_isr_one_error_type(struct pci_dev *root,
12821276
struct aer_err_info *info)
12831277
{
1284-
aer_print_port_info(root, info);
1278+
bool found;
12851279

1286-
if (find_source_device(root, info))
1280+
found = find_source_device(root, info);
1281+
aer_print_port_info(root, info, found);
1282+
if (found)
12871283
aer_process_err_devices(info);
12881284
}
12891285

0 commit comments

Comments
 (0)