diff options
author | Henrik Kretzschmar <henne@nachtwindheim.de> | 2011-02-22 09:38:05 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-02-23 05:38:45 -0500 |
commit | 7167d08e780a722fa79ea414fc4e72bc00751392 (patch) | |
tree | f6a103d7de511142c362bc216e886a4eb2ac69bc | |
parent | b6a1432da81fa387d76215108dc9f6ea6d343aed (diff) |
x86: Rework arch_disable_smp_support() for x86
Currently arch_disable_smp_support() on x86 disables only the
support for the IOAPIC and is also compiled in if SMP-support is
not.
Therefore this function is renamed to disable_ioapic_support(),
which meets its purpose and is only compiled in the kernel
when IOAPIC support is also.
A new arch_disable_smp_support() is created in smpboot.c,
which calls disable_ioapic_support() and gets only compiled
in the kernel when SMP support is also.
Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
LKML-Reference: <1298385487-4708-3-git-send-email-henne@nachtwindheim.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/include/asm/io_apic.h | 3 | ||||
-rw-r--r-- | arch/x86/kernel/apic/apic.c | 3 | ||||
-rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 7 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot.c | 11 |
4 files changed, 20 insertions, 4 deletions
diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h index b24915fcd6df..0be2f27b78f3 100644 --- a/arch/x86/include/asm/io_apic.h +++ b/arch/x86/include/asm/io_apic.h | |||
@@ -175,6 +175,8 @@ extern void __init pre_init_apic_IRQ0(void); | |||
175 | 175 | ||
176 | extern void mp_save_irq(struct mpc_intsrc *m); | 176 | extern void mp_save_irq(struct mpc_intsrc *m); |
177 | 177 | ||
178 | extern void disable_ioapic_support(void); | ||
179 | |||
178 | #else /* !CONFIG_X86_IO_APIC */ | 180 | #else /* !CONFIG_X86_IO_APIC */ |
179 | 181 | ||
180 | #define io_apic_assign_pci_irqs 0 | 182 | #define io_apic_assign_pci_irqs 0 |
@@ -189,6 +191,7 @@ struct io_apic_irq_attr; | |||
189 | static inline int io_apic_set_pci_routing(struct device *dev, int irq, | 191 | static inline int io_apic_set_pci_routing(struct device *dev, int irq, |
190 | struct io_apic_irq_attr *irq_attr) { return 0; } | 192 | struct io_apic_irq_attr *irq_attr) { return 0; } |
191 | static inline void mp_save_irq(struct mpc_intsrc *m) { }; | 193 | static inline void mp_save_irq(struct mpc_intsrc *m) { }; |
194 | static inline void disable_ioapic_support(void) { } | ||
192 | #endif | 195 | #endif |
193 | 196 | ||
194 | #endif /* _ASM_X86_IO_APIC_H */ | 197 | #endif /* _ASM_X86_IO_APIC_H */ |
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 76b96d74978a..96e68099b06e 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include <asm/i8259.h> | 43 | #include <asm/i8259.h> |
44 | #include <asm/proto.h> | 44 | #include <asm/proto.h> |
45 | #include <asm/apic.h> | 45 | #include <asm/apic.h> |
46 | #include <asm/io_apic.h> | ||
46 | #include <asm/desc.h> | 47 | #include <asm/desc.h> |
47 | #include <asm/hpet.h> | 48 | #include <asm/hpet.h> |
48 | #include <asm/idle.h> | 49 | #include <asm/idle.h> |
@@ -1209,7 +1210,7 @@ void __cpuinit setup_local_APIC(void) | |||
1209 | rdtscll(tsc); | 1210 | rdtscll(tsc); |
1210 | 1211 | ||
1211 | if (disable_apic) { | 1212 | if (disable_apic) { |
1212 | arch_disable_smp_support(); | 1213 | disable_ioapic_support(); |
1213 | return; | 1214 | return; |
1214 | } | 1215 | } |
1215 | 1216 | ||
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index ca9e2a3545a9..a2f2bf8ab9db 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -108,7 +108,10 @@ DECLARE_BITMAP(mp_bus_not_pci, MAX_MP_BUSSES); | |||
108 | 108 | ||
109 | int skip_ioapic_setup; | 109 | int skip_ioapic_setup; |
110 | 110 | ||
111 | void arch_disable_smp_support(void) | 111 | /** |
112 | * disable_ioapic_support() - disables ioapic support at runtime | ||
113 | */ | ||
114 | void disable_ioapic_support(void) | ||
112 | { | 115 | { |
113 | #ifdef CONFIG_PCI | 116 | #ifdef CONFIG_PCI |
114 | noioapicquirk = 1; | 117 | noioapicquirk = 1; |
@@ -120,7 +123,7 @@ void arch_disable_smp_support(void) | |||
120 | static int __init parse_noapic(char *str) | 123 | static int __init parse_noapic(char *str) |
121 | { | 124 | { |
122 | /* disable IO-APIC */ | 125 | /* disable IO-APIC */ |
123 | arch_disable_smp_support(); | 126 | disable_ioapic_support(); |
124 | return 0; | 127 | return 0; |
125 | } | 128 | } |
126 | early_param("noapic", parse_noapic); | 129 | early_param("noapic", parse_noapic); |
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 08776a953487..09d0172a0059 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -64,6 +64,7 @@ | |||
64 | #include <asm/mtrr.h> | 64 | #include <asm/mtrr.h> |
65 | #include <asm/mwait.h> | 65 | #include <asm/mwait.h> |
66 | #include <asm/apic.h> | 66 | #include <asm/apic.h> |
67 | #include <asm/io_apic.h> | ||
67 | #include <asm/setup.h> | 68 | #include <asm/setup.h> |
68 | #include <asm/uv/uv.h> | 69 | #include <asm/uv/uv.h> |
69 | #include <linux/mc146818rtc.h> | 70 | #include <linux/mc146818rtc.h> |
@@ -945,6 +946,14 @@ int __cpuinit native_cpu_up(unsigned int cpu) | |||
945 | return 0; | 946 | return 0; |
946 | } | 947 | } |
947 | 948 | ||
949 | /** | ||
950 | * arch_disable_smp_support() - disables SMP support for x86 at runtime | ||
951 | */ | ||
952 | void arch_disable_smp_support(void) | ||
953 | { | ||
954 | disable_ioapic_support(); | ||
955 | } | ||
956 | |||
948 | /* | 957 | /* |
949 | * Fall back to non SMP mode after errors. | 958 | * Fall back to non SMP mode after errors. |
950 | * | 959 | * |
@@ -1045,7 +1054,7 @@ static int __init smp_sanity_check(unsigned max_cpus) | |||
1045 | "(tell your hw vendor)\n"); | 1054 | "(tell your hw vendor)\n"); |
1046 | } | 1055 | } |
1047 | smpboot_clear_io_apic(); | 1056 | smpboot_clear_io_apic(); |
1048 | arch_disable_smp_support(); | 1057 | disable_ioapic_support(); |
1049 | return -1; | 1058 | return -1; |
1050 | } | 1059 | } |
1051 | 1060 | ||