diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2011-09-27 09:48:23 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-09-14 05:15:01 -0400 |
commit | ac6c7998712d55bd15aa2dd5ae85f5988c0cb526 (patch) | |
tree | 4701fee21c526e5aefc46fb1ba48e81383086ace | |
parent | 2d8b21d95f44989e09fd9b36ca9f061ad5bc567e (diff) |
ARM: smp: Make SMP operations mandatory
Now that all SMP platforms have been converted to use struct
smp_operations, remove the "weak" attribute from the hooks
in smp.c, and make the functions static wherever possible.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r-- | arch/arm/include/asm/smp.h | 14 | ||||
-rw-r--r-- | arch/arm/kernel/smp.c | 18 |
2 files changed, 9 insertions, 23 deletions
diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h index f79a9f51e322..3a8cfee26c91 100644 --- a/arch/arm/include/asm/smp.h +++ b/arch/arm/include/asm/smp.h | |||
@@ -60,15 +60,6 @@ extern int boot_secondary(unsigned int cpu, struct task_struct *); | |||
60 | */ | 60 | */ |
61 | asmlinkage void secondary_start_kernel(void); | 61 | asmlinkage void secondary_start_kernel(void); |
62 | 62 | ||
63 | /* | ||
64 | * Perform platform specific initialisation of the specified CPU. | ||
65 | */ | ||
66 | extern void platform_secondary_init(unsigned int cpu); | ||
67 | |||
68 | /* | ||
69 | * Initialize cpu_possible map, and enable coherency | ||
70 | */ | ||
71 | extern void platform_smp_prepare_cpus(unsigned int); | ||
72 | 63 | ||
73 | /* | 64 | /* |
74 | * Initial data for bringing up a secondary CPU. | 65 | * Initial data for bringing up a secondary CPU. |
@@ -81,15 +72,10 @@ struct secondary_data { | |||
81 | extern struct secondary_data secondary_data; | 72 | extern struct secondary_data secondary_data; |
82 | 73 | ||
83 | extern int __cpu_disable(void); | 74 | extern int __cpu_disable(void); |
84 | extern int platform_cpu_disable(unsigned int cpu); | ||
85 | 75 | ||
86 | extern void __cpu_die(unsigned int cpu); | 76 | extern void __cpu_die(unsigned int cpu); |
87 | extern void cpu_die(void); | 77 | extern void cpu_die(void); |
88 | 78 | ||
89 | extern void platform_cpu_die(unsigned int cpu); | ||
90 | extern int platform_cpu_kill(unsigned int cpu); | ||
91 | extern void platform_cpu_enable(unsigned int cpu); | ||
92 | |||
93 | extern void arch_send_call_function_single_ipi(int cpu); | 79 | extern void arch_send_call_function_single_ipi(int cpu); |
94 | extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); | 80 | extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); |
95 | 81 | ||
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index d9241885521b..ac3ce029afb8 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
@@ -110,25 +110,25 @@ int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *idle) | |||
110 | } | 110 | } |
111 | 111 | ||
112 | /* platform specific SMP operations */ | 112 | /* platform specific SMP operations */ |
113 | void __attribute__((weak)) __init smp_init_cpus(void) | 113 | void __init smp_init_cpus(void) |
114 | { | 114 | { |
115 | if (smp_ops.smp_init_cpus) | 115 | if (smp_ops.smp_init_cpus) |
116 | smp_ops.smp_init_cpus(); | 116 | smp_ops.smp_init_cpus(); |
117 | } | 117 | } |
118 | 118 | ||
119 | void __attribute__((weak)) __init platform_smp_prepare_cpus(unsigned int max_cpus) | 119 | static void __init platform_smp_prepare_cpus(unsigned int max_cpus) |
120 | { | 120 | { |
121 | if (smp_ops.smp_prepare_cpus) | 121 | if (smp_ops.smp_prepare_cpus) |
122 | smp_ops.smp_prepare_cpus(max_cpus); | 122 | smp_ops.smp_prepare_cpus(max_cpus); |
123 | } | 123 | } |
124 | 124 | ||
125 | void __attribute__((weak)) __cpuinit platform_secondary_init(unsigned int cpu) | 125 | static void __cpuinit platform_secondary_init(unsigned int cpu) |
126 | { | 126 | { |
127 | if (smp_ops.smp_secondary_init) | 127 | if (smp_ops.smp_secondary_init) |
128 | smp_ops.smp_secondary_init(cpu); | 128 | smp_ops.smp_secondary_init(cpu); |
129 | } | 129 | } |
130 | 130 | ||
131 | int __attribute__((weak)) __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | 131 | int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) |
132 | { | 132 | { |
133 | if (smp_ops.smp_boot_secondary) | 133 | if (smp_ops.smp_boot_secondary) |
134 | return smp_ops.smp_boot_secondary(cpu, idle); | 134 | return smp_ops.smp_boot_secondary(cpu, idle); |
@@ -138,20 +138,20 @@ int __attribute__((weak)) __cpuinit boot_secondary(unsigned int cpu, struct task | |||
138 | #ifdef CONFIG_HOTPLUG_CPU | 138 | #ifdef CONFIG_HOTPLUG_CPU |
139 | static void percpu_timer_stop(void); | 139 | static void percpu_timer_stop(void); |
140 | 140 | ||
141 | int __attribute__((weak)) platform_cpu_kill(unsigned int cpu) | 141 | static int platform_cpu_kill(unsigned int cpu) |
142 | { | 142 | { |
143 | if (smp_ops.cpu_kill) | 143 | if (smp_ops.cpu_kill) |
144 | return smp_ops.cpu_kill(cpu); | 144 | return smp_ops.cpu_kill(cpu); |
145 | return 1; | 145 | return 1; |
146 | } | 146 | } |
147 | 147 | ||
148 | void __attribute__((weak)) platform_cpu_die(unsigned int cpu) | 148 | static void platform_cpu_die(unsigned int cpu) |
149 | { | 149 | { |
150 | if (smp_ops.cpu_die) | 150 | if (smp_ops.cpu_die) |
151 | smp_ops.cpu_die(cpu); | 151 | smp_ops.cpu_die(cpu); |
152 | } | 152 | } |
153 | 153 | ||
154 | int __attribute__((weak)) platform_cpu_disable(unsigned int cpu) | 154 | static int platform_cpu_disable(unsigned int cpu) |
155 | { | 155 | { |
156 | if (smp_ops.cpu_disable) | 156 | if (smp_ops.cpu_disable) |
157 | return smp_ops.cpu_disable(cpu); | 157 | return smp_ops.cpu_disable(cpu); |
@@ -166,7 +166,7 @@ int __attribute__((weak)) platform_cpu_disable(unsigned int cpu) | |||
166 | /* | 166 | /* |
167 | * __cpu_disable runs on the processor to be shutdown. | 167 | * __cpu_disable runs on the processor to be shutdown. |
168 | */ | 168 | */ |
169 | int __cpu_disable(void) | 169 | int __cpuinit __cpu_disable(void) |
170 | { | 170 | { |
171 | unsigned int cpu = smp_processor_id(); | 171 | unsigned int cpu = smp_processor_id(); |
172 | int ret; | 172 | int ret; |
@@ -209,7 +209,7 @@ static DECLARE_COMPLETION(cpu_died); | |||
209 | * called on the thread which is asking for a CPU to be shutdown - | 209 | * called on the thread which is asking for a CPU to be shutdown - |
210 | * waits until shutdown has completed, or it is timed out. | 210 | * waits until shutdown has completed, or it is timed out. |
211 | */ | 211 | */ |
212 | void __cpu_die(unsigned int cpu) | 212 | void __cpuinit __cpu_die(unsigned int cpu) |
213 | { | 213 | { |
214 | if (!wait_for_completion_timeout(&cpu_died, msecs_to_jiffies(5000))) { | 214 | if (!wait_for_completion_timeout(&cpu_died, msecs_to_jiffies(5000))) { |
215 | pr_err("CPU%u: cpu didn't die\n", cpu); | 215 | pr_err("CPU%u: cpu didn't die\n", cpu); |