Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dff22d20 authored by Lorenzo Pieralisi's avatar Lorenzo Pieralisi Committed by Bjorn Helgaas
Browse files

PCI: Call pci_read_bridge_bases() from core instead of arch code



When we scan a PCI bus, we read PCI-PCI bridge window registers with
pci_read_bridge_bases() so we can validate the resource hierarchy.  Most
architectures call pci_read_bridge_bases() from pcibios_fixup_bus(), but
PCI-PCI bridges are not arch-specific, so this doesn't need to be in
arch-specific code.

Call pci_read_bridge_bases() directly from the PCI core instead of from
arch code.

For alpha and mips, we now call pci_read_bridge_bases() always; previously
we only called it if PCI_PROBE_ONLY was set.

[bhelgaas: changelog]
Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
CC: Ralf Baechle <ralf@linux-mips.org>
CC: James E.J. Bottomley <jejb@parisc-linux.org>
CC: Michael Ellerman <mpe@ellerman.id.au>
CC: Bjorn Helgaas <bhelgaas@google.com>
CC: Richard Henderson <rth@twiddle.net>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: David Howells <dhowells@redhat.com>
CC: Russell King <linux@arm.linux.org.uk>
CC: Tony Luck <tony.luck@intel.com>
CC: David S. Miller <davem@davemloft.net>
CC: Ingo Molnar <mingo@redhat.com>
CC: Guenter Roeck <linux@roeck-us.net>
CC: Michal Simek <monstr@monstr.eu>
CC: Chris Zankel <chris@zankel.net>
parent bc0195aa
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -242,12 +242,7 @@ pci_restore_srm_config(void)

void pcibios_fixup_bus(struct pci_bus *bus)
{
	struct pci_dev *dev = bus->self;

	if (pci_has_flag(PCI_PROBE_ONLY) && dev &&
 		   (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
 		pci_read_bridge_bases(bus);
	} 
	struct pci_dev *dev;

	list_for_each_entry(dev, &bus->devices, bus_list) {
		pdev_save_srm_config(dev);
+0 −2
Original line number Diff line number Diff line
@@ -294,8 +294,6 @@ void pcibios_fixup_bus(struct pci_bus *bus)
	printk("### PCIBIOS_FIXUP_BUS(%d)\n",bus->number);
#endif

	pci_read_bridge_bases(bus);

	if (bus->number == 0) {
		struct pci_dev *dev;
		list_for_each_entry(dev, &bus->devices, bus_list) {
+2 −3
Original line number Diff line number Diff line
@@ -533,10 +533,9 @@ void pcibios_fixup_bus(struct pci_bus *b)
{
	struct pci_dev *dev;

	if (b->self) {
		pci_read_bridge_bases(b);
	if (b->self)
		pcibios_fixup_bridge_resources(b->self);
	}

	list_for_each_entry(dev, &b->devices, bus_list)
		pcibios_fixup_device_resources(dev);
	platform_pci_fixup_bus(b);
+1 −8
Original line number Diff line number Diff line
@@ -863,14 +863,7 @@ void pcibios_setup_bus_devices(struct pci_bus *bus)

void pcibios_fixup_bus(struct pci_bus *bus)
{
	/* When called from the generic PCI probe, read PCI<->PCI bridge
	 * bases. This is -not- called when generating the PCI tree from
	 * the OF device-tree.
	 */
	if (bus->self != NULL)
		pci_read_bridge_bases(bus);

	/* Now fixup the bus bus */
	/* Fixup the bus */
	pcibios_setup_bus_self(bus);

	/* Now fixup devices on that bus */
+0 −6
Original line number Diff line number Diff line
@@ -311,12 +311,6 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)

void pcibios_fixup_bus(struct pci_bus *bus)
{
	struct pci_dev *dev = bus->self;

	if (pci_has_flag(PCI_PROBE_ONLY) && dev &&
	    (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
		pci_read_bridge_bases(bus);
	}
}

EXPORT_SYMBOL(PCIBIOS_MIN_IO);
Loading