Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc: Convert platforms to smp_generic_cpu_bootable

T4, Cell, powernv, and pseries had the same implementation, so switch
them to use a generic version. A2 apparently had a version, but
removed it at some point, so we remove the declaration, too.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Andy Fleming and committed by
Benjamin Herrenschmidt
39fd4027 3cd85250

+4 -49
+1
arch/powerpc/platforms/85xx/smp.c
··· 255 255 256 256 struct smp_ops_t smp_85xx_ops = { 257 257 .kick_cpu = smp_85xx_kick_cpu, 258 + .cpu_bootable = smp_generic_cpu_bootable, 258 259 #ifdef CONFIG_HOTPLUG_CPU 259 260 .cpu_disable = generic_cpu_disable, 260 261 .cpu_die = generic_cpu_die,
+1 -14
arch/powerpc/platforms/cell/smp.c
··· 136 136 return 0; 137 137 } 138 138 139 - static int smp_cell_cpu_bootable(unsigned int nr) 140 - { 141 - /* Special case - we inhibit secondary thread startup 142 - * during boot if the user requests it. Odd-numbered 143 - * cpus are assumed to be secondary threads. 144 - */ 145 - if (system_state == SYSTEM_BOOTING && 146 - cpu_has_feature(CPU_FTR_SMT) && 147 - !smt_enabled_at_boot && cpu_thread_in_core(nr) != 0) 148 - return 0; 149 - 150 - return 1; 151 - } 152 139 static struct smp_ops_t bpa_iic_smp_ops = { 153 140 .message_pass = iic_message_pass, 154 141 .probe = smp_iic_probe, 155 142 .kick_cpu = smp_cell_kick_cpu, 156 143 .setup_cpu = smp_cell_setup_cpu, 157 - .cpu_bootable = smp_cell_cpu_bootable, 144 + .cpu_bootable = smp_generic_cpu_bootable, 158 145 }; 159 146 160 147 /* This is called very early */
+1 -17
arch/powerpc/platforms/powernv/smp.c
··· 46 46 xics_setup_cpu(); 47 47 } 48 48 49 - static int pnv_smp_cpu_bootable(unsigned int nr) 50 - { 51 - /* Special case - we inhibit secondary thread startup 52 - * during boot if the user requests it. 53 - */ 54 - if (system_state == SYSTEM_BOOTING && cpu_has_feature(CPU_FTR_SMT)) { 55 - if (!smt_enabled_at_boot && cpu_thread_in_core(nr) != 0) 56 - return 0; 57 - if (smt_enabled_at_boot 58 - && cpu_thread_in_core(nr) >= smt_enabled_at_boot) 59 - return 0; 60 - } 61 - 62 - return 1; 63 - } 64 - 65 49 int pnv_smp_kick_cpu(int nr) 66 50 { 67 51 unsigned int pcpu = get_hard_smp_processor_id(nr); ··· 179 195 .probe = xics_smp_probe, 180 196 .kick_cpu = pnv_smp_kick_cpu, 181 197 .setup_cpu = pnv_smp_setup_cpu, 182 - .cpu_bootable = pnv_smp_cpu_bootable, 198 + .cpu_bootable = smp_generic_cpu_bootable, 183 199 #ifdef CONFIG_HOTPLUG_CPU 184 200 .cpu_disable = pnv_smp_cpu_disable, 185 201 .cpu_die = generic_cpu_die,
+1 -17
arch/powerpc/platforms/pseries/smp.c
··· 187 187 return 0; 188 188 } 189 189 190 - static int smp_pSeries_cpu_bootable(unsigned int nr) 191 - { 192 - /* Special case - we inhibit secondary thread startup 193 - * during boot if the user requests it. 194 - */ 195 - if (system_state == SYSTEM_BOOTING && cpu_has_feature(CPU_FTR_SMT)) { 196 - if (!smt_enabled_at_boot && cpu_thread_in_core(nr) != 0) 197 - return 0; 198 - if (smt_enabled_at_boot 199 - && cpu_thread_in_core(nr) >= smt_enabled_at_boot) 200 - return 0; 201 - } 202 - 203 - return 1; 204 - } 205 - 206 190 /* Only used on systems that support multiple IPI mechanisms */ 207 191 static void pSeries_cause_ipi_mux(int cpu, unsigned long data) 208 192 { ··· 221 237 .probe = pSeries_smp_probe, 222 238 .kick_cpu = smp_pSeries_kick_cpu, 223 239 .setup_cpu = smp_xics_setup_cpu, 224 - .cpu_bootable = smp_pSeries_cpu_bootable, 240 + .cpu_bootable = smp_generic_cpu_bootable, 225 241 }; 226 242 227 243 /* This is called very early */
-1
arch/powerpc/platforms/wsp/wsp.h
··· 17 17 extern void a2_setup_smp(void); 18 18 extern int a2_scom_startup_cpu(unsigned int lcpu, int thr_idx, 19 19 struct device_node *np); 20 - extern int smp_a2_cpu_bootable(unsigned int nr); 21 20 extern int smp_a2_kick_cpu(int nr); 22 21 23 22 extern void opb_pic_init(void);