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

Commit c431ada4 authored by Rajesh Shah's avatar Rajesh Shah Committed by Greg Kroah-Hartman
Browse files

[PATCH] acpi bridge hotadd: ACPI based root bridge hot-add



When you hot-plug a (root) bridge hierarchy, it may have p2p bridges and
devices attached to it that have not been configured by firmware.  In this
case, we need to configure the devices before starting them.  This patch
separates device start from device scan so that we can introduce the
configuration step in the middle.

I kept the existing semantics for pci_scan_bus() since there are a huge number
of callers to that function.

Also, I have no way of testing the changes I made to the parisc files, so this
needs review by those folks.  Sorry for the massive cross-post, this touches
files in many different places.

Signed-off-by: default avatarRajesh Shah <rajesh.shah@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent efe1ec27
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -134,7 +134,7 @@ struct pci_bus * __devinit pcibios_scan_root(int busnum)

	printk("PCI: Probing PCI hardware (bus %02x)\n", busnum);

	return pci_scan_bus(busnum, &pci_root_ops, NULL);
	return pci_scan_bus_parented(NULL, busnum, &pci_root_ops, NULL);
}

extern u8 pci_cache_line_size;
+2 −0
Original line number Diff line number Diff line
@@ -45,6 +45,8 @@ static int __init pci_legacy_init(void)

	printk("PCI: Probing PCI hardware\n");
	pci_root_bus = pcibios_scan_root(0);
	if (pci_root_bus)
		pci_bus_add_devices(pci_root_bus);

	pcibios_fixup_peer_bridges();

+2 −0
Original line number Diff line number Diff line
@@ -115,6 +115,8 @@ static int __init pci_numa_init(void)
		return 0;

	pci_root_bus = pcibios_scan_root(0);
	if (pci_root_bus)
		pci_bus_add_devices(pci_root_bus);
	if (num_online_nodes() > 1)
		for_each_online_node(quad) {
			if (quad == 0)
+1 −1
Original line number Diff line number Diff line
@@ -312,7 +312,7 @@ pci_acpi_scan_root(struct acpi_device *device, int domain, int bus)
	acpi_walk_resources(device->handle, METHOD_NAME__CRS, add_window,
			&info);

	pbus = pci_scan_bus(bus, &pci_root_ops, controller);
	pbus = pci_scan_bus_parented(NULL, bus, &pci_root_ops, controller);
	if (pbus)
		pcibios_setup_root_windows(pbus, controller);

+15 −1
Original line number Diff line number Diff line
@@ -129,6 +129,8 @@ acpi_pci_bind (
	char			*pathname = NULL;
	struct acpi_buffer	buffer = {0, NULL};
	acpi_handle		handle = NULL;
	struct pci_dev		*dev;
	struct pci_bus 		*bus;

	ACPI_FUNCTION_TRACE("acpi_pci_bind");

@@ -193,8 +195,20 @@ acpi_pci_bind (
	 * Locate matching device in PCI namespace.  If it doesn't exist
	 * this typically means that the device isn't currently inserted
	 * (e.g. docking station, port replicator, etc.).
	 * We cannot simply search the global pci device list, since
	 * PCI devices are added to the global pci list when the root
	 * bridge start ops are run, which may not have happened yet.
	 */
	data->dev = pci_find_slot(data->id.bus, PCI_DEVFN(data->id.device, data->id.function));
	bus = pci_find_bus(data->id.segment, data->id.bus);
	if (bus) {
		list_for_each_entry(dev, &bus->devices, bus_list) {
			if (dev->devfn == PCI_DEVFN(data->id.device,
						data->id.function)) {
				data->dev = dev;
				break;
			}
		}
	}
	if (!data->dev) {
		ACPI_DEBUG_PRINT((ACPI_DB_INFO, 
			"Device %02x:%02x:%02x.%02x not present in PCI namespace\n",
Loading