Skip to content

Commit a9af571

Browse files
committed
Merge branch 'pci/enumeration'
- Support BAR sizes up to 8TB (Dongdong Liu) - Reduce warnings on hardware that doesn't support 8- or 16-bit PCI writes and hence may corrupt RW1C bits (Mark Tomlinson) * pci/enumeration: PCI: Reduce warnings on possible RW1C corruption PCI: Support BAR sizes up to 8TB
2 parents fde14ee + 92c45b6 commit a9af571

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

drivers/pci/access.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,12 @@ int pci_generic_config_write32(struct pci_bus *bus, unsigned int devfn,
159159
* write happen to have any RW1C (write-one-to-clear) bits set, we
160160
* just inadvertently cleared something we shouldn't have.
161161
*/
162-
dev_warn_ratelimited(&bus->dev, "%d-byte config write to %04x:%02x:%02x.%d offset %#x may corrupt adjacent RW1C bits\n",
163-
size, pci_domain_nr(bus), bus->number,
164-
PCI_SLOT(devfn), PCI_FUNC(devfn), where);
162+
if (!bus->unsafe_warn) {
163+
dev_warn(&bus->dev, "%d-byte config write to %04x:%02x:%02x.%d offset %#x may corrupt adjacent RW1C bits\n",
164+
size, pci_domain_nr(bus), bus->number,
165+
PCI_SLOT(devfn), PCI_FUNC(devfn), where);
166+
bus->unsafe_warn = 1;
167+
}
165168

166169
mask = ~(((1 << (size * 8)) - 1) << ((where & 0x3) * 8));
167170
tmp = readl(addr) & mask;

drivers/pci/setup-bus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
994994
{
995995
struct pci_dev *dev;
996996
resource_size_t min_align, align, size, size0, size1;
997-
resource_size_t aligns[18]; /* Alignments from 1MB to 128GB */
997+
resource_size_t aligns[24]; /* Alignments from 1MB to 8TB */
998998
int order, max_order;
999999
struct resource *b_res = find_bus_resource_of_type(bus,
10001000
mask | IORESOURCE_PREFETCH, type);

include/linux/pci.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,7 @@ struct pci_bus {
668668
struct bin_attribute *legacy_io; /* Legacy I/O for this bus */
669669
struct bin_attribute *legacy_mem; /* Legacy mem */
670670
unsigned int is_added:1;
671+
unsigned int unsafe_warn:1; /* warned about RW1C config write */
671672
};
672673

673674
#define to_pci_bus(n) container_of(n, struct pci_bus, dev)

0 commit comments

Comments
 (0)