aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/smp.c
diff options
context:
space:
mode:
authorAndy Fleming <afleming@freescale.com>2013-08-05 15:58:34 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-08-14 00:56:50 -0400
commit3cd852502316d42e3e75859e92d9f0a952bb55a2 (patch)
treebb87519fb5ee650c007e0a19ac1c452f0d07602d /arch/powerpc/kernel/smp.c
parent3b04c300070f5ee2608b092e98aa121b963cec26 (diff)
powerpc: Add smp_generic_cpu_bootable
Cell and PSeries both implemented their own versions of a cpu_bootable smp_op which do the same thing (well, the PSeries one has support for more than 2 threads). Copy the PSeries one to generic code, and rename it smp_generic_cpu_bootable. Signed-off-by: Andy Fleming <afleming@freescale.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/smp.c')
-rw-r--r--arch/powerpc/kernel/smp.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 9882240020c0..e69211293789 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -81,6 +81,28 @@ int smt_enabled_at_boot = 1;
81 81
82static void (*crash_ipi_function_ptr)(struct pt_regs *) = NULL; 82static void (*crash_ipi_function_ptr)(struct pt_regs *) = NULL;
83 83
84/*
85 * Returns 1 if the specified cpu should be brought up during boot.
86 * Used to inhibit booting threads if they've been disabled or
87 * limited on the command line
88 */
89int smp_generic_cpu_bootable(unsigned int nr)
90{
91 /* Special case - we inhibit secondary thread startup
92 * during boot if the user requests it.
93 */
94 if (system_state == SYSTEM_BOOTING && cpu_has_feature(CPU_FTR_SMT)) {
95 if (!smt_enabled_at_boot && cpu_thread_in_core(nr) != 0)
96 return 0;
97 if (smt_enabled_at_boot
98 && cpu_thread_in_core(nr) >= smt_enabled_at_boot)
99 return 0;
100 }
101
102 return 1;
103}
104
105
84#ifdef CONFIG_PPC64 106#ifdef CONFIG_PPC64
85int smp_generic_kick_cpu(int nr) 107int smp_generic_kick_cpu(int nr)
86{ 108{