From 7be3754601ac48194f13afa997a85e7065f481af Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 12 Apr 2022 16:29:13 +0200 Subject: [PATCH] Revert "PCI: Reduce warnings on possible RW1C corruption" This reverts commit e37d269734ee9866bef3f965d4f545b86352f326. It breaks the kernel abi so revert it for now. We will add it back later at the next kabi update. Bug: 161946584 Signed-off-by: Greg Kroah-Hartman Change-Id: Ib838120a97e202ad9c407552bbc978030a9a43b3 --- drivers/pci/access.c | 9 +++------ include/linux/pci.h | 1 - 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/pci/access.c b/drivers/pci/access.c index 8d0d1f61c650..46935695cfb9 100644 --- a/drivers/pci/access.c +++ b/drivers/pci/access.c @@ -160,12 +160,9 @@ int pci_generic_config_write32(struct pci_bus *bus, unsigned int devfn, * write happen to have any RW1C (write-one-to-clear) bits set, we * just inadvertently cleared something we shouldn't have. */ - if (!bus->unsafe_warn) { - dev_warn(&bus->dev, "%d-byte config write to %04x:%02x:%02x.%d offset %#x may corrupt adjacent RW1C bits\n", - size, pci_domain_nr(bus), bus->number, - PCI_SLOT(devfn), PCI_FUNC(devfn), where); - bus->unsafe_warn = 1; - } + dev_warn_ratelimited(&bus->dev, "%d-byte config write to %04x:%02x:%02x.%d offset %#x may corrupt adjacent RW1C bits\n", + size, pci_domain_nr(bus), bus->number, + PCI_SLOT(devfn), PCI_FUNC(devfn), where); mask = ~(((1 << (size * 8)) - 1) << ((where & 0x3) * 8)); tmp = readl(addr) & mask; diff --git a/include/linux/pci.h b/include/linux/pci.h index 9d6e75222868..152a4d74f87f 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -656,7 +656,6 @@ struct pci_bus { struct bin_attribute *legacy_io; /* Legacy I/O for this bus */ struct bin_attribute *legacy_mem; /* Legacy mem */ unsigned int is_added:1; - unsigned int unsafe_warn:1; /* warned about RW1C config write */ }; #define to_pci_bus(n) container_of(n, struct pci_bus, dev)