From: Rafael J. Wysocki Date: Thu, 20 Dec 2012 23:36:40 +0000 (+0100) Subject: ACPI: Change the ordering of PCI root bridge driver registrarion X-Git-Tag: v3.9-rc1~146^2~12^2~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=92ef2a25c763338905dce8344a0584606f842920;p=profile%2Fivi%2Fkernel-x86-ivi.git ACPI: Change the ordering of PCI root bridge driver registrarion Instead of running acpi_pci_root_init() from a separate subsys initcall, call it directly from acpi_scan_init() before scanning the ACPI namespace for the first time, so that the PCI root bridge driver's .add() routine, acpi_pci_root_start(), is always run before binding ACPI drivers or attaching "companion" device objects to struct acpi_device objects below the root bridge's device node in the ACPI namespace. The first, simpler reason for doing this is that it makes the situation during boot more similar to the situation during hotplug, in which the ACPI PCI root bridge driver is always present. The second reason is that acpi_pci_root_init() causes struct pci_dev objects to be created for all PCI devices below the bridge and these objects may be necessary for whatever is done with the other ACPI device nodes in that namespace scope. For example, devices created by acpi_create_platform_device() sometimes may need to be added to the device hierarchy as children of PCI bridges. For this purpose, however, the struct pci_dev objects representing those bridges need to exist before the platform devices in question are registered. Signed-off-by: Rafael J. Wysocki Acked-by: Yinghai Lu Acked-by: Toshi Kani --- diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h index 3c407cd..e050254 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h @@ -67,6 +67,7 @@ struct acpi_ec { extern struct acpi_ec *first_ec; +int acpi_pci_root_init(void); int acpi_ec_init(void); int acpi_ec_ecdt_probe(void); int acpi_boot_ec_enable(void); diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 7928d4d..a233fe9 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -699,7 +699,7 @@ static int acpi_pci_root_remove(struct acpi_device *device, int type) return 0; } -static int __init acpi_pci_root_init(void) +int __init acpi_pci_root_init(void) { acpi_hest_init(); @@ -712,5 +712,3 @@ static int __init acpi_pci_root_init(void) return 0; } - -subsys_initcall(acpi_pci_root_init); diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 726f0d1..a7e81ac 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -1831,6 +1831,7 @@ int __init acpi_scan_init(void) } acpi_power_init(); + acpi_pci_root_init(); /* * Enumerate devices in the ACPI namespace.