Skip to content

Commit 6bb4bef

Browse files
committed
PCI/AER: Trace error event before ratelimiting
As with the AER statistics, we always want to emit trace events, even if the actual dmesg logging is rate limited. Call trace_aer_event() immediately after pci_dev_aer_stats_incr() so both happen before ratelimiting. 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]> Link: https://patch.msgid.link/[email protected]
1 parent 88a7765 commit 6bb4bef

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/pci/pcie/aer.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,8 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info)
715715
const char *level;
716716

717717
pci_dev_aer_stats_incr(dev, info);
718+
trace_aer_event(pci_name(dev), (info->status & ~info->mask),
719+
info->severity, info->tlp_header_valid, &info->tlp);
718720

719721
if (!info->status) {
720722
pci_err(dev, "PCIe Bus Error: severity=%s, type=Inaccessible, (Unregistered Agent ID)\n",
@@ -742,9 +744,6 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info)
742744
out:
743745
if (info->id && info->error_dev_num > 1 && info->id == id)
744746
pci_err(dev, " Error of this Agent is reported first\n");
745-
746-
trace_aer_event(dev_name(&dev->dev), (info->status & ~info->mask),
747-
info->severity, info->tlp_header_valid, &info->tlp);
748747
}
749748

750749
#ifdef CONFIG_ACPI_APEI_PCIEAER
@@ -785,6 +784,8 @@ void pci_print_aer(struct pci_dev *dev, int aer_severity,
785784
info.mask = mask;
786785

787786
pci_dev_aer_stats_incr(dev, &info);
787+
trace_aer_event(pci_name(dev), (status & ~mask),
788+
aer_severity, tlp_header_valid, &aer->header_log);
788789

789790
layer = AER_GET_LAYER_ERROR(aer_severity, status);
790791
agent = AER_GET_AGENT(aer_severity, status);
@@ -800,9 +801,6 @@ void pci_print_aer(struct pci_dev *dev, int aer_severity,
800801

801802
if (tlp_header_valid)
802803
pcie_print_tlp_log(dev, &aer->header_log, dev_fmt(" "));
803-
804-
trace_aer_event(pci_name(dev), (status & ~mask),
805-
aer_severity, tlp_header_valid, &aer->header_log);
806804
}
807805
EXPORT_SYMBOL_NS_GPL(pci_print_aer, "CXL");
808806

0 commit comments

Comments
 (0)