Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI/AER: Unify error bit printing for native and CPER reporting

AER errors can be reported natively (Linux AER driver fields interrupts and
reads error state directly from hardware) or via the ACPI/APEI/GHES/CPER
path (platform firmware reads error state from hardware and sends it to
Linux via ACPI interfaces).

Previously the same error would produce different output depending on
whether it was reported natively or via ACPI. The CPER path resulted in
hard-to-understand messages, without a prefix. Instead use
__aer_print_error() for both native AER and CPER to provide a more
consistent log format.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
[bhelgaas: changelog]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

authored by

Alexandru Gagniuc and committed by
Bjorn Helgaas
5d0b401f 60cc43fc

+9 -7
+9 -7
drivers/pci/pcie/aer/aerdrv_errprint.c
··· 216 216 void cper_print_aer(struct pci_dev *dev, int aer_severity, 217 217 struct aer_capability_regs *aer) 218 218 { 219 - int layer, agent, status_strs_size, tlp_header_valid = 0; 219 + int layer, agent, tlp_header_valid = 0; 220 220 u32 status, mask; 221 - const char **status_strs; 221 + struct aer_err_info info; 222 222 223 223 if (aer_severity == AER_CORRECTABLE) { 224 224 status = aer->cor_status; 225 225 mask = aer->cor_mask; 226 - status_strs = aer_correctable_error_string; 227 - status_strs_size = ARRAY_SIZE(aer_correctable_error_string); 228 226 } else { 229 227 status = aer->uncor_status; 230 228 mask = aer->uncor_mask; 231 - status_strs = aer_uncorrectable_error_string; 232 - status_strs_size = ARRAY_SIZE(aer_uncorrectable_error_string); 233 229 tlp_header_valid = status & AER_LOG_TLP_MASKS; 234 230 } 235 231 236 232 layer = AER_GET_LAYER_ERROR(aer_severity, status); 237 233 agent = AER_GET_AGENT(aer_severity, status); 238 234 235 + memset(&info, 0, sizeof(info)); 236 + info.severity = aer_severity; 237 + info.status = status; 238 + info.mask = mask; 239 + info.first_error = PCI_ERR_CAP_FEP(aer->cap_control); 240 + 239 241 pci_err(dev, "aer_status: 0x%08x, aer_mask: 0x%08x\n", status, mask); 240 - cper_print_bits("", status, status_strs, status_strs_size); 242 + __aer_print_error(dev, &info); 241 243 pci_err(dev, "aer_layer=%s, aer_agent=%s\n", 242 244 aer_error_layer[layer], aer_agent_string[agent]); 243 245