x86/pci: removing subsys_initcall ordering dependencies

So far subsys_initcalls has been executed in this order depending on
the object order in the Makefile:

arch/x86/pci/visws.c:subsys_initcall(pcibios_init);
arch/x86/pci/numa.c:subsys_initcall(pci_numa_init);
arch/x86/pci/acpi.c:subsys_initcall(pci_acpi_init);
arch/x86/pci/legacy.c:subsys_initcall(pci_legacy_init);
arch/x86/pci/irq.c:subsys_initcall(pcibios_irq_init);
arch/x86/pci/common.c:subsys_initcall(pcibios_init);

This patch removes the ordering dependency. There is now only one
subsys_initcall function that contains subsystem initialization code
with a defined order.

Signed-off-by: Robert Richter <robert.richter@amd.com>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Robert Richter 2008-07-02 22:50:29 +02:00 committed by Ingo Molnar
parent ae28d70529
commit 8dd779b19c
9 changed files with 36 additions and 21 deletions

View File

@ -6,10 +6,6 @@ obj-$(CONFIG_PCI_DIRECT) += direct.o
obj-$(CONFIG_PCI_OLPC) += olpc.o
pci-y := fixup.o
# Do not change the ordering here. There is a nasty init function
# ordering dependency which breaks when you move acpi.o below
# legacy/irq.o
pci-$(CONFIG_ACPI) += acpi.o
pci-y += legacy.o irq.o

View File

@ -223,7 +223,7 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int do
return bus;
}
static int __init pci_acpi_init(void)
int __init pci_acpi_init(void)
{
struct pci_dev *dev = NULL;
@ -257,4 +257,3 @@ static int __init pci_acpi_init(void)
return 0;
}
subsys_initcall(pci_acpi_init);

View File

@ -384,7 +384,7 @@ struct pci_bus * __devinit pcibios_scan_root(int busnum)
extern u8 pci_cache_line_size;
static int __init pcibios_init(void)
int __init pcibios_init(void)
{
struct cpuinfo_x86 *c = &boot_cpu_data;
@ -411,8 +411,6 @@ static int __init pcibios_init(void)
return 0;
}
subsys_initcall(pcibios_init);
char * __devinit pcibios_setup(char *str)
{
if (!strcmp(str, "off")) {

View File

@ -4,7 +4,7 @@
/* arch_initcall has too random ordering, so call the initializers
in the right sequence from here. */
static __init int pci_access_init(void)
static __init int pci_arch_init(void)
{
#ifdef CONFIG_PCI_DIRECT
int type = 0;
@ -40,4 +40,4 @@ static __init int pci_access_init(void)
return 0;
}
arch_initcall(pci_access_init);
arch_initcall(pci_arch_init);

View File

@ -1107,7 +1107,7 @@ static struct dmi_system_id __initdata pciirq_dmi_table[] = {
{ }
};
static int __init pcibios_irq_init(void)
int __init pcibios_irq_init(void)
{
DBG(KERN_DEBUG "PCI: IRQ init\n");
@ -1142,9 +1142,6 @@ static int __init pcibios_irq_init(void)
return 0;
}
subsys_initcall(pcibios_irq_init);
static void pirq_penalize_isa_irq(int irq, int active)
{
/*

View File

@ -55,4 +55,13 @@ static int __init pci_legacy_init(void)
return 0;
}
subsys_initcall(pci_legacy_init);
int __init pci_subsys_init(void)
{
#ifdef CONFIG_ACPI
pci_acpi_init();
#endif
pci_legacy_init();
pcibios_irq_init();
pcibios_init();
}
subsys_initcall(pci_subsys_init);

View File

@ -177,4 +177,10 @@ static int __init pci_numa_init(void)
return 0;
}
subsys_initcall(pci_numa_init);
static __init int pci_subsys_init(void)
{
pci_numa_init();
pcibios_irq_init();
pcibios_init();
}
subsys_initcall(pci_subsys_init);

View File

@ -39,9 +39,6 @@ enum pci_bf_sort_state {
pci_dmi_bf,
};
extern void __init dmi_check_pciprobe(void);
extern void __init dmi_check_skip_isa_align(void);
/* pci-i386.c */
extern unsigned int pcibios_max_latency;
@ -99,10 +96,18 @@ extern struct pci_raw_ops *raw_pci_ext_ops;
extern struct pci_raw_ops pci_direct_conf1;
/* arch_initcall level */
extern int pci_direct_probe(void);
extern void pci_direct_init(int type);
extern void pci_pcbios_init(void);
extern int pci_olpc_init(void);
extern void __init dmi_check_pciprobe(void);
extern void __init dmi_check_skip_isa_align(void);
/* some common used subsys_initcalls */
extern int __init pci_acpi_init(void);
extern int __init pcibios_irq_init(void);
extern int __init pcibios_init(void);
/* pci-mmconfig.c */

View File

@ -105,4 +105,9 @@ static int __init pci_visws_init(void)
return 0;
}
subsys_initcall(pci_visws_init);
static __init int pci_subsys_init(void)
{
pci_visws_init();
pcibios_init();
}
subsys_initcall(pci_subsys_init);