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

Commit 928bea96 authored by Yinghai Lu's avatar Yinghai Lu Committed by Bjorn Helgaas
Browse files

PCI: Delay enabling bridges until they're needed



We currently enable PCI bridges after scanning a bus and assigning
resources.  This is often done in arch code.

This patch changes this so we don't enable a bridge until necessary, i.e.,
until we enable a PCI device behind the bridge.  We do this in the generic
pci_enable_device() path, so this also removes the arch-specific code to
enable bridges.

[bhelgaas: changelog]
Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 55ed83a6
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -525,11 +525,6 @@ void pci_common_init_dev(struct device *parent, struct hw_pci *hw)
			 * Assign resources.
			 */
			pci_bus_assign_resources(bus);

			/*
			 * Enable bridges
			 */
			pci_enable_bridges(bus);
		}

		/*
+0 −1
Original line number Diff line number Diff line
@@ -319,7 +319,6 @@ static int __init mcf_pci_init(void)
	pci_fixup_irqs(pci_common_swizzle, mcf_pci_map_irq);
	pci_bus_size_bridges(rootbus);
	pci_bus_assign_resources(rootbus);
	pci_enable_bridges(rootbus);
	return 0;
}

+0 −1
Original line number Diff line number Diff line
@@ -113,7 +113,6 @@ static void pcibios_scanbus(struct pci_controller *hose)
		if (!pci_has_flag(PCI_PROBE_ONLY)) {
			pci_bus_size_bridges(bus);
			pci_bus_assign_resources(bus);
			pci_enable_bridges(bus);
		}
	}
}
+0 −1
Original line number Diff line number Diff line
@@ -69,7 +69,6 @@ static void pcibios_scanbus(struct pci_channel *hose)

		pci_bus_size_bridges(bus);
		pci_bus_assign_resources(bus);
		pci_enable_bridges(bus);
	} else {
		pci_free_resource_list(&resources);
	}
+0 −3
Original line number Diff line number Diff line
@@ -527,9 +527,6 @@ static int acpi_pci_root_add(struct acpi_device *device,
	if (system_state != SYSTEM_BOOTING) {
		pcibios_resource_survey_bus(root->bus);
		pci_assign_unassigned_bus_resources(root->bus);

		/* need to after hot-added ioapic is registered */
		pci_enable_bridges(root->bus);
	}

	pci_bus_add_devices(root->bus);
Loading