Skip to content

Commit 88a7765

Browse files
committed
PCI/AER: Update statistics before ratelimiting
There are two AER logging entry points: - aer_print_error() is used by DPC (dpc_process_error()) and native AER handling (aer_process_err_devices()). - pci_print_aer() is used by GHES (aer_recover_work_func()) and CXL (cxl_handle_rdport_errors()) Both use __aer_print_error() to print the AER error bits. Previously __aer_print_error() also incremented the AER statistics via pci_dev_aer_stats_incr(). Call pci_dev_aer_stats_incr() early in the entry points instead of in __aer_print_error() so we update the statistics even if the actual printing of error bits is rate limited by a future change. Signed-off-by: Bjorn Helgaas <[email protected]> Tested-by: Krzysztof Wilczyński <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Reviewed-by: Kuppuswamy Sathyanarayanan <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent ad98391 commit 88a7765

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/pci/pcie/aer.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,6 @@ static void __aer_print_error(struct pci_dev *dev,
693693
aer_printk(level, dev, " [%2d] %-22s%s\n", i, errmsg,
694694
info->first_error == i ? " (First)" : "");
695695
}
696-
pci_dev_aer_stats_incr(dev, info);
697696
}
698697

699698
static void aer_print_source(struct pci_dev *dev, struct aer_err_info *info,
@@ -715,6 +714,8 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info)
715714
int id = pci_dev_id(dev);
716715
const char *level;
717716

717+
pci_dev_aer_stats_incr(dev, info);
718+
718719
if (!info->status) {
719720
pci_err(dev, "PCIe Bus Error: severity=%s, type=Inaccessible, (Unregistered Agent ID)\n",
720721
aer_error_severity_string[info->severity]);
@@ -783,6 +784,8 @@ void pci_print_aer(struct pci_dev *dev, int aer_severity,
783784
info.status = status;
784785
info.mask = mask;
785786

787+
pci_dev_aer_stats_incr(dev, &info);
788+
786789
layer = AER_GET_LAYER_ERROR(aer_severity, status);
787790
agent = AER_GET_AGENT(aer_severity, status);
788791

0 commit comments

Comments
 (0)