]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
PCI: Reduce warnings on possible RW1C corruption
authorMark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
Thu, 6 Aug 2020 04:14:55 +0000 (16:14 +1200)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:57:51 +0000 (11:57 +0200)
commit245c9d90656ed7316e11fbd6cabf154cac9c6fd4
tree6a22e3693b2a5ac5a07c69e03512bc66dd928112
parent848f3d14765f96351f6cf5d994b69c42ce035f88
PCI: Reduce warnings on possible RW1C corruption

BugLink: https://bugs.launchpad.net/bugs/1969110
[ Upstream commit 92c45b63ce22c8898aa41806e8d6692bcd577510 ]

For hardware that only supports 32-bit writes to PCI there is the
possibility of clearing RW1C (write-one-to-clear) bits. A rate-limited
messages was introduced by fb2659230120, but rate-limiting is not the best
choice here. Some devices may not show the warnings they should if another
device has just produced a bunch of warnings. Also, the number of messages
can be a nuisance on devices which are otherwise working fine.

Change the ratelimit to a single warning per bus. This ensures no bus is
'starved' of emitting a warning and also that there isn't a continuous
stream of warnings. It would be preferable to have a warning per device,
but the pci_dev structure is not available here, and a lookup from devfn
would be far too slow.

Suggested-by: Bjorn Helgaas <helgaas@kernel.org>
Fixes: fb2659230120 ("PCI: Warn on possible RW1C corruption for sub-32 bit config writes")
Link: https://lore.kernel.org/r/20200806041455.11070-1-mark.tomlinson@alliedtelesis.co.nz
Signed-off-by: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit e37d269734ee9866bef3f965d4f545b86352f326)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/pci/access.c
include/linux/pci.h