Commit a9af571b authored by Bjorn Helgaas's avatar Bjorn Helgaas
Browse files

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
parents fde14ee6 92c45b63
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -159,9 +159,12 @@ 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.
	 */
	dev_warn_ratelimited(&bus->dev, "%d-byte config write to %04x:%02x:%02x.%d offset %#x may corrupt adjacent RW1C bits\n",
	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;
	}

	mask = ~(((1 << (size * 8)) - 1) << ((where & 0x3) * 8));
	tmp = readl(addr) & mask;
+1 −1
Original line number Diff line number Diff line
@@ -994,7 +994,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
{
	struct pci_dev *dev;
	resource_size_t min_align, align, size, size0, size1;
	resource_size_t aligns[18]; /* Alignments from 1MB to 128GB */
	resource_size_t aligns[24]; /* Alignments from 1MB to 8TB */
	int order, max_order;
	struct resource *b_res = find_bus_resource_of_type(bus,
					mask | IORESOURCE_PREFETCH, type);
+1 −0
Original line number Diff line number Diff line
@@ -668,6 +668,7 @@ 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)