Skip to content

Commit e83e2ca

Browse files
Kangiebjorn-helgaas
authored andcommitted
PCI/AER: Log correctable errors as warning, not error
PCIe correctable errors are recovered by hardware with no need for software intervention (PCIe r5.0, sec 6.2.2.1). Reduce the log level of correctable errors from KERN_ERR to KERN_WARNING. The bug reports below are for correctable error logging. This doesn't fix the cause of those reports, but it may make the messages less alarming. [bhelgaas: commit log, use pci_printk() to avoid code duplication] Link: https://bugzilla.kernel.org/show_bug.cgi?id=201517 Link: https://bugzilla.kernel.org/show_bug.cgi?id=196183 Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Matt Jolly <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent 0678e31 commit e83e2ca

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

drivers/pci/pcie/aer.c

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -673,20 +673,23 @@ static void __aer_print_error(struct pci_dev *dev,
673673
{
674674
const char **strings;
675675
unsigned long status = info->status & ~info->mask;
676-
const char *errmsg;
676+
const char *level, *errmsg;
677677
int i;
678678

679-
if (info->severity == AER_CORRECTABLE)
679+
if (info->severity == AER_CORRECTABLE) {
680680
strings = aer_correctable_error_string;
681-
else
681+
level = KERN_WARNING;
682+
} else {
682683
strings = aer_uncorrectable_error_string;
684+
level = KERN_ERR;
685+
}
683686

684687
for_each_set_bit(i, &status, 32) {
685688
errmsg = strings[i];
686689
if (!errmsg)
687690
errmsg = "Unknown Error Bit";
688691

689-
pci_err(dev, " [%2d] %-22s%s\n", i, errmsg,
692+
pci_printk(level, dev, " [%2d] %-22s%s\n", i, errmsg,
690693
info->first_error == i ? " (First)" : "");
691694
}
692695
pci_dev_aer_stats_incr(dev, info);
@@ -696,6 +699,7 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info)
696699
{
697700
int layer, agent;
698701
int id = ((dev->bus->number << 8) | dev->devfn);
702+
const char *level;
699703

700704
if (!info->status) {
701705
pci_err(dev, "PCIe Bus Error: severity=%s, type=Inaccessible, (Unregistered Agent ID)\n",
@@ -706,13 +710,14 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info)
706710
layer = AER_GET_LAYER_ERROR(info->severity, info->status);
707711
agent = AER_GET_AGENT(info->severity, info->status);
708712

709-
pci_err(dev, "PCIe Bus Error: severity=%s, type=%s, (%s)\n",
710-
aer_error_severity_string[info->severity],
711-
aer_error_layer[layer], aer_agent_string[agent]);
713+
level = (info->severity == AER_CORRECTABLE) ? KERN_WARNING : KERN_ERR;
714+
715+
pci_printk(level, dev, "PCIe Bus Error: severity=%s, type=%s, (%s)\n",
716+
aer_error_severity_string[info->severity],
717+
aer_error_layer[layer], aer_agent_string[agent]);
712718

713-
pci_err(dev, " device [%04x:%04x] error status/mask=%08x/%08x\n",
714-
dev->vendor, dev->device,
715-
info->status, info->mask);
719+
pci_printk(level, dev, " device [%04x:%04x] error status/mask=%08x/%08x\n",
720+
dev->vendor, dev->device, info->status, info->mask);
716721

717722
__aer_print_error(dev, info);
718723

0 commit comments

Comments
 (0)