提交 2ca344e8 编写于 作者: J Jiang Liu 提交者: Bjorn Helgaas

PCI: acpiphp: Create companion ACPI devices before creating PCI devices

With commit 4f535093 "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: NJiang Liu <jiang.liu@huawei.com>
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
上级 40064acf
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册