History

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

Bjorn Helgaas committed 4 years ago

Commit a9af5712 parents fde14ee 92c45b63 files · +8 −4Browse files

Unified · Split

3 files
  1. drivers/pci/access.c +6 −3
  2. drivers/pci/setup-bus.c +1 −1
  3. include/linux/pci.h +1 −0
drivers/pci/access.c+6−3
@@ -159,9 +159,12 @@ int pci_generic_config_write32(struct pci_bus *bus, unsigned int devfn, · 158 unmodified lines
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+1−1
@@ -994,7 +994,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask, · 993 unmodified lines
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+1−0
@@ -668,6 +668,7 @@ struct pci_bus { · 667 unmodified lines
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)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t