6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Lukas Wunner [ Upstream commit a8bf2dd750de7d682fdaa2127f4e3217ce9c4a82 ] Per PCIe r7.0 sec 6.2.5, the prefix and header of an offending TLP is only recorded for unmasked Uncorrectable Errors. Yet when the AER driver determines whether a prefix and header has been logged, it does not take the Uncorrectable Error Mask Register into account. Fix it. Fixes: 6c2b374d7485 ("PCI-Express AER implemetation: AER core and aerdriver") Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org # v2.6.19+ Link: https://patch.msgid.link/2e712b96ba5bfc729d78bfc23f7fb7d285aa3d6d.1784905909.git.lukas@wunner.de [ sashal: Open-coded the unmasked-status check as (status & ~mask) & AER_LOG_TLP_MASKS in two places, since this tree has no tlp_header_logged() helper to modify. ] Signed-off-by: Sasha Levin --- drivers/pci/pcie/aer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index 0e00ea3ae0b5a..592b40e51eaa2 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -785,7 +785,7 @@ void pci_print_aer(struct pci_dev *dev, int aer_severity, } else { status = aer->uncor_status; mask = aer->uncor_mask; - tlp_header_valid = status & AER_LOG_TLP_MASKS; + tlp_header_valid = (status & ~mask) & AER_LOG_TLP_MASKS; } layer = AER_GET_LAYER_ERROR(aer_severity, status); @@ -1252,7 +1252,7 @@ int aer_get_device_error_info(struct pci_dev *dev, struct aer_err_info *info) pci_read_config_dword(dev, aer + PCI_ERR_CAP, &aercc); info->first_error = PCI_ERR_CAP_FEP(aercc); - if (info->status & AER_LOG_TLP_MASKS) { + if ((info->status & ~info->mask) & AER_LOG_TLP_MASKS) { info->tlp_header_valid = 1; pcie_read_tlp_log(dev, aer + PCI_ERR_HEADER_LOG, &info->tlp); } -- 2.53.0