diff options
author | Robert Richter <robert.richter@amd.com> | 2008-07-02 16:50:29 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-09 05:45:03 -0400 |
commit | 8dd779b19ce5972072ad2372a86c8acbae4da768 (patch) | |
tree | 4f594473f7aa2f10a5af4d724a8ac06ca96925cf /arch | |
parent | ae28d70529b874f657afd0f70ca148599345ba2a (diff) |
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/pci/Makefile | 4 | ||||
-rw-r--r-- | arch/x86/pci/acpi.c | 3 | ||||
-rw-r--r-- | arch/x86/pci/common.c | 4 | ||||
-rw-r--r-- | arch/x86/pci/init.c | 4 | ||||
-rw-r--r-- | arch/x86/pci/irq.c | 5 | ||||
-rw-r--r-- | arch/x86/pci/legacy.c | 11 | ||||
-rw-r--r-- | arch/x86/pci/numa.c | 8 | ||||
-rw-r--r-- | arch/x86/pci/pci.h | 11 | ||||
-rw-r--r-- | arch/x86/pci/visws.c | 7 |
9 files changed, 36 insertions, 21 deletions
diff --git a/arch/x86/pci/Makefile b/arch/x86/pci/Makefile index 1ba1236094a4..99d9f095e4d4 100644 --- a/arch/x86/pci/Makefile +++ b/arch/x86/pci/Makefile | |||
@@ -6,10 +6,6 @@ obj-$(CONFIG_PCI_DIRECT) += direct.o | |||
6 | obj-$(CONFIG_PCI_OLPC) += olpc.o | 6 | obj-$(CONFIG_PCI_OLPC) += olpc.o |
7 | 7 | ||
8 | pci-y := fixup.o | 8 | pci-y := fixup.o |
9 | |||
10 | # Do not change the ordering here. There is a nasty init function | ||
11 | # ordering dependency which breaks when you move acpi.o below | ||
12 | # legacy/irq.o | ||
13 | pci-$(CONFIG_ACPI) += acpi.o | 9 | pci-$(CONFIG_ACPI) += acpi.o |
14 | pci-y += legacy.o irq.o | 10 | pci-y += legacy.o irq.o |
15 | 11 | ||
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index 4fa52d3dc848..19af06927fbc 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c | |||
@@ -223,7 +223,7 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int do | |||
223 | return bus; | 223 | return bus; |
224 | } | 224 | } |
225 | 225 | ||
226 | static int __init pci_acpi_init(void) | 226 | int __init pci_acpi_init(void) |
227 | { | 227 | { |
228 | struct pci_dev *dev = NULL; | 228 | struct pci_dev *dev = NULL; |
229 | 229 | ||
@@ -257,4 +257,3 @@ static int __init pci_acpi_init(void) | |||
257 | 257 | ||
258 | return 0; | 258 | return 0; |
259 | } | 259 | } |
260 | subsys_initcall(pci_acpi_init); | ||
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c index 6e64aaf00d1d..20b9f59f95df 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c | |||
@@ -384,7 +384,7 @@ struct pci_bus * __devinit pcibios_scan_root(int busnum) | |||
384 | 384 | ||
385 | extern u8 pci_cache_line_size; | 385 | extern u8 pci_cache_line_size; |
386 | 386 | ||
387 | static int __init pcibios_init(void) | 387 | int __init pcibios_init(void) |
388 | { | 388 | { |
389 | struct cpuinfo_x86 *c = &boot_cpu_data; | 389 | struct cpuinfo_x86 *c = &boot_cpu_data; |
390 | 390 | ||
@@ -411,8 +411,6 @@ static int __init pcibios_init(void) | |||
411 | return 0; | 411 | return 0; |
412 | } | 412 | } |
413 | 413 | ||
414 | subsys_initcall(pcibios_init); | ||
415 | |||
416 | char * __devinit pcibios_setup(char *str) | 414 | char * __devinit pcibios_setup(char *str) |
417 | { | 415 | { |
418 | if (!strcmp(str, "off")) { | 416 | if (!strcmp(str, "off")) { |
diff --git a/arch/x86/pci/init.c b/arch/x86/pci/init.c index b821f4462d99..d6c950f81858 100644 --- a/arch/x86/pci/init.c +++ b/arch/x86/pci/init.c | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | /* arch_initcall has too random ordering, so call the initializers | 5 | /* arch_initcall has too random ordering, so call the initializers |
6 | in the right sequence from here. */ | 6 | in the right sequence from here. */ |
7 | static __init int pci_access_init(void) | 7 | static __init int pci_arch_init(void) |
8 | { | 8 | { |
9 | #ifdef CONFIG_PCI_DIRECT | 9 | #ifdef CONFIG_PCI_DIRECT |
10 | int type = 0; | 10 | int type = 0; |
@@ -40,4 +40,4 @@ static __init int pci_access_init(void) | |||
40 | 40 | ||
41 | return 0; | 41 | return 0; |
42 | } | 42 | } |
43 | arch_initcall(pci_access_init); | 43 | arch_initcall(pci_arch_init); |
diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c index f0859de23e20..dc568c6b83f8 100644 --- a/arch/x86/pci/irq.c +++ b/arch/x86/pci/irq.c | |||
@@ -1107,7 +1107,7 @@ static struct dmi_system_id __initdata pciirq_dmi_table[] = { | |||
1107 | { } | 1107 | { } |
1108 | }; | 1108 | }; |
1109 | 1109 | ||
1110 | static int __init pcibios_irq_init(void) | 1110 | int __init pcibios_irq_init(void) |
1111 | { | 1111 | { |
1112 | DBG(KERN_DEBUG "PCI: IRQ init\n"); | 1112 | DBG(KERN_DEBUG "PCI: IRQ init\n"); |
1113 | 1113 | ||
@@ -1142,9 +1142,6 @@ static int __init pcibios_irq_init(void) | |||
1142 | return 0; | 1142 | return 0; |
1143 | } | 1143 | } |
1144 | 1144 | ||
1145 | subsys_initcall(pcibios_irq_init); | ||
1146 | |||
1147 | |||
1148 | static void pirq_penalize_isa_irq(int irq, int active) | 1145 | static void pirq_penalize_isa_irq(int irq, int active) |
1149 | { | 1146 | { |
1150 | /* | 1147 | /* |
diff --git a/arch/x86/pci/legacy.c b/arch/x86/pci/legacy.c index a67921ce60af..3c1d795cbbe9 100644 --- a/arch/x86/pci/legacy.c +++ b/arch/x86/pci/legacy.c | |||
@@ -55,4 +55,13 @@ static int __init pci_legacy_init(void) | |||
55 | return 0; | 55 | return 0; |
56 | } | 56 | } |
57 | 57 | ||
58 | subsys_initcall(pci_legacy_init); | 58 | int __init pci_subsys_init(void) |
59 | { | ||
60 | #ifdef CONFIG_ACPI | ||
61 | pci_acpi_init(); | ||
62 | #endif | ||
63 | pci_legacy_init(); | ||
64 | pcibios_irq_init(); | ||
65 | pcibios_init(); | ||
66 | } | ||
67 | subsys_initcall(pci_subsys_init); | ||
diff --git a/arch/x86/pci/numa.c b/arch/x86/pci/numa.c index 99f1ecd485b5..e1620dc8649a 100644 --- a/arch/x86/pci/numa.c +++ b/arch/x86/pci/numa.c | |||
@@ -177,4 +177,10 @@ static int __init pci_numa_init(void) | |||
177 | return 0; | 177 | return 0; |
178 | } | 178 | } |
179 | 179 | ||
180 | subsys_initcall(pci_numa_init); | 180 | static __init int pci_subsys_init(void) |
181 | { | ||
182 | pci_numa_init(); | ||
183 | pcibios_irq_init(); | ||
184 | pcibios_init(); | ||
185 | } | ||
186 | subsys_initcall(pci_subsys_init); | ||
diff --git a/arch/x86/pci/pci.h b/arch/x86/pci/pci.h index ba263e626a68..58241748470f 100644 --- a/arch/x86/pci/pci.h +++ b/arch/x86/pci/pci.h | |||
@@ -39,9 +39,6 @@ enum pci_bf_sort_state { | |||
39 | pci_dmi_bf, | 39 | pci_dmi_bf, |
40 | }; | 40 | }; |
41 | 41 | ||
42 | extern void __init dmi_check_pciprobe(void); | ||
43 | extern void __init dmi_check_skip_isa_align(void); | ||
44 | |||
45 | /* pci-i386.c */ | 42 | /* pci-i386.c */ |
46 | 43 | ||
47 | extern unsigned int pcibios_max_latency; | 44 | extern unsigned int pcibios_max_latency; |
@@ -99,10 +96,18 @@ extern struct pci_raw_ops *raw_pci_ext_ops; | |||
99 | 96 | ||
100 | extern struct pci_raw_ops pci_direct_conf1; | 97 | extern struct pci_raw_ops pci_direct_conf1; |
101 | 98 | ||
99 | /* arch_initcall level */ | ||
102 | extern int pci_direct_probe(void); | 100 | extern int pci_direct_probe(void); |
103 | extern void pci_direct_init(int type); | 101 | extern void pci_direct_init(int type); |
104 | extern void pci_pcbios_init(void); | 102 | extern void pci_pcbios_init(void); |
105 | extern int pci_olpc_init(void); | 103 | extern int pci_olpc_init(void); |
104 | extern void __init dmi_check_pciprobe(void); | ||
105 | extern void __init dmi_check_skip_isa_align(void); | ||
106 | |||
107 | /* some common used subsys_initcalls */ | ||
108 | extern int __init pci_acpi_init(void); | ||
109 | extern int __init pcibios_irq_init(void); | ||
110 | extern int __init pcibios_init(void); | ||
106 | 111 | ||
107 | /* pci-mmconfig.c */ | 112 | /* pci-mmconfig.c */ |
108 | 113 | ||
diff --git a/arch/x86/pci/visws.c b/arch/x86/pci/visws.c index c3dc9f26812c..16e52063ecb3 100644 --- a/arch/x86/pci/visws.c +++ b/arch/x86/pci/visws.c | |||
@@ -105,4 +105,9 @@ static int __init pci_visws_init(void) | |||
105 | return 0; | 105 | return 0; |
106 | } | 106 | } |
107 | 107 | ||
108 | subsys_initcall(pci_visws_init); | 108 | static __init int pci_subsys_init(void) |
109 | { | ||
110 | pci_visws_init(); | ||
111 | pcibios_init(); | ||
112 | } | ||
113 | subsys_initcall(pci_subsys_init); | ||