]> git.baikalelectronics.ru Git - 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:24:22 +0000 (14:24 +0200)
commit1c1982d58e8ab6992e0aa82a563f1d155a4d0ddc
tree2290620fd3e7755c6cf683823679d381c20f6e7f
parentccfe4c56351c68ba01653a12e0a7613c7f18a0f3
PCI/AER: Iterate over error counters instead of error strings

[ Upstream commit 310b89250e068ff8cfa1ee35181c0f25797493aa ]

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: 43a5ae59c0eb ("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>
drivers/pci/pcie/aer.c