From: Jiang Liu Date: Wed, 30 Jan 2013 16:10:09 +0000 (+0800) Subject: PCI: acpiphp: Create companion ACPI devices before creating PCI devices X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2ca344e8c798127ae01e656838b9b06ed41d1461;p=linux-beck.git PCI: acpiphp: Create companion ACPI devices before creating PCI devices With commit 4f535093cf8f6da8c "PCI: Put pci_dev in device tree as early as possible", companion ACPI devices should be created before creating corresponding PCI devices, otherwise it will break the ACPI PCI binding logic. Without this patch, the /sys/bus/pci/devices/.../firmware_node symlink is missing after hot-removing and hot-adding a device with acpiphp. Signed-off-by: Jiang Liu Signed-off-by: Bjorn Helgaas --- diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index bd784ff4a244..acb7af220310 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c @@ -839,6 +839,9 @@ static int __ref enable_device(struct acpiphp_slot *slot) if (slot->flags & SLOT_ENABLED) goto err_exit; + list_for_each_entry(func, &slot->funcs, sibling) + acpiphp_bus_add(func); + num = pci_scan_slot(bus, PCI_DEVFN(slot->device, 0)); if (num == 0) { /* Maybe only part of funcs are added. */ @@ -862,9 +865,6 @@ static int __ref enable_device(struct acpiphp_slot *slot) } } - list_for_each_entry(func, &slot->funcs, sibling) - acpiphp_bus_add(func); - pci_bus_assign_resources(bus); acpiphp_sanitize_bus(bus); acpiphp_set_hpp_values(bus);