]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
PCI/AER: Iterate over error counters instead of error strings
authorMohamed Khalfella <mkhalfella@purestorage.com>
Mon, 9 May 2022 18:14:41 +0000 (18:14 +0000)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 17 Oct 2022 09:57:04 +0000 (11:57 +0200)
commitd19777e3c35ad7d55b31cfbff35552d9eb5fce1d
treecdaf7b7771f355fc6c568be9f3f93f1d6431d06d
parent8f39da8716eeb0b7368465ee3cf2f5825b8b5081
PCI/AER: Iterate over error counters instead of error strings

BugLink: https://bugs.launchpad.net/bugs/1990162
[ Upstream commit 5e6ae050955b566484f3cc6a66e3925eae87a0ed ]

Previously we iterated over AER stat *names*, e.g.,
aer_correctable_error_string[32], but the actual stat *counters* may not be
that large, e.g., pdev->aer_stats->dev_cor_errs[16], which means that we
printed junk in the sysfs stats files.

Iterate over the stat counter arrays instead of the names to avoid this
junk.

Also, added a build time check to make sure all
counters have entries in strings array.

Fixes: 0678e3109a3c ("PCI/AER: Simplify __aer_print_error()")
Link: https://lore.kernel.org/r/20220509181441.31884-1-mkhalfella@purestorage.com
Reported-by: Meeta Saggi <msaggi@purestorage.com>
Signed-off-by: Mohamed Khalfella <mkhalfella@purestorage.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Meeta Saggi <msaggi@purestorage.com>
Reviewed-by: Eric Badger <ebadger@purestorage.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/pci/pcie/aer.c