Skip to content

Commit

Permalink
PCI: acpiphp: Create companion ACPI devices before creating PCI devices
Browse files Browse the repository at this point in the history
With commit 4f53509 "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 <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
  • Loading branch information
Jiang Liu authored and Bjorn Helgaas committed Feb 1, 2013
1 parent 40064ac commit 2ca344e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/pci/hotplug/acpiphp_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand All @@ -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);
Expand Down

0 comments on commit 2ca344e

Please sign in to comment.