powerpc: Convert platforms to smp_generic_cpu_bootable
authorAndy Fleming <afleming@freescale.com>
Mon, 5 Aug 2013 19:58:35 +0000 (14:58 -0500)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 14 Aug 2013 04:56:57 +0000 (14:56 +1000)
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>
arch/powerpc/platforms/85xx/smp.c
arch/powerpc/platforms/cell/smp.c
arch/powerpc/platforms/powernv/smp.c
arch/powerpc/platforms/pseries/smp.c
arch/powerpc/platforms/wsp/wsp.h

index 5ced4f5bb2b2e70dbc4a2a90b1a4679b5ae802a2..ea9c6269ead06e6d8e7fcfecaf2c82be34adbf31 100644 (file)
@@ -255,6 +255,7 @@ out:
 
 struct smp_ops_t smp_85xx_ops = {
        .kick_cpu = smp_85xx_kick_cpu,
+       .cpu_bootable = smp_generic_cpu_bootable,
 #ifdef CONFIG_HOTPLUG_CPU
        .cpu_disable    = generic_cpu_disable,
        .cpu_die        = generic_cpu_die,
index f75f6fcac7296267d44b8a28d3d2b16446878acc..90745eaa45fe9551b71c2479fc1ce8060f8abd0c 100644 (file)
@@ -136,25 +136,12 @@ static int smp_cell_kick_cpu(int nr)
        return 0;
 }
 
-static int smp_cell_cpu_bootable(unsigned int nr)
-{
-       /* Special case - we inhibit secondary thread startup
-        * during boot if the user requests it.  Odd-numbered
-        * cpus are assumed to be secondary threads.
-        */
-       if (system_state == SYSTEM_BOOTING &&
-           cpu_has_feature(CPU_FTR_SMT) &&
-           !smt_enabled_at_boot && cpu_thread_in_core(nr) != 0)
-               return 0;
-
-       return 1;
-}
 static struct smp_ops_t bpa_iic_smp_ops = {
        .message_pass   = iic_message_pass,
        .probe          = smp_iic_probe,
        .kick_cpu       = smp_cell_kick_cpu,
        .setup_cpu      = smp_cell_setup_cpu,
-       .cpu_bootable   = smp_cell_cpu_bootable,
+       .cpu_bootable   = smp_generic_cpu_bootable,
 };
 
 /* This is called very early */
index 89e3857af4e0913679448c5cc78c6549d17b29e9..908672bdcea6b2c77d75763a05d10f476e2b2d75 100644 (file)
@@ -46,22 +46,6 @@ static void pnv_smp_setup_cpu(int cpu)
                xics_setup_cpu();
 }
 
-static int pnv_smp_cpu_bootable(unsigned int nr)
-{
-       /* Special case - we inhibit secondary thread startup
-        * during boot if the user requests it.
-        */
-       if (system_state == SYSTEM_BOOTING && cpu_has_feature(CPU_FTR_SMT)) {
-               if (!smt_enabled_at_boot && cpu_thread_in_core(nr) != 0)
-                       return 0;
-               if (smt_enabled_at_boot
-                   && cpu_thread_in_core(nr) >= smt_enabled_at_boot)
-                       return 0;
-       }
-
-       return 1;
-}
-
 int pnv_smp_kick_cpu(int nr)
 {
        unsigned int pcpu = get_hard_smp_processor_id(nr);
@@ -195,7 +179,7 @@ static struct smp_ops_t pnv_smp_ops = {
        .probe          = xics_smp_probe,
        .kick_cpu       = pnv_smp_kick_cpu,
        .setup_cpu      = pnv_smp_setup_cpu,
-       .cpu_bootable   = pnv_smp_cpu_bootable,
+       .cpu_bootable   = smp_generic_cpu_bootable,
 #ifdef CONFIG_HOTPLUG_CPU
        .cpu_disable    = pnv_smp_cpu_disable,
        .cpu_die        = generic_cpu_die,
index 306643cc9dbcc6cf8d1a317a84fc98c2c4af0c10..ca2d1f6647f4047096649bd750e254debb740d26 100644 (file)
@@ -187,22 +187,6 @@ static int smp_pSeries_kick_cpu(int nr)
        return 0;
 }
 
-static int smp_pSeries_cpu_bootable(unsigned int nr)
-{
-       /* Special case - we inhibit secondary thread startup
-        * during boot if the user requests it.
-        */
-       if (system_state == SYSTEM_BOOTING && cpu_has_feature(CPU_FTR_SMT)) {
-               if (!smt_enabled_at_boot && cpu_thread_in_core(nr) != 0)
-                       return 0;
-               if (smt_enabled_at_boot
-                   && cpu_thread_in_core(nr) >= smt_enabled_at_boot)
-                       return 0;
-       }
-
-       return 1;
-}
-
 /* Only used on systems that support multiple IPI mechanisms */
 static void pSeries_cause_ipi_mux(int cpu, unsigned long data)
 {
@@ -237,7 +221,7 @@ static struct smp_ops_t pSeries_xics_smp_ops = {
        .probe          = pSeries_smp_probe,
        .kick_cpu       = smp_pSeries_kick_cpu,
        .setup_cpu      = smp_xics_setup_cpu,
-       .cpu_bootable   = smp_pSeries_cpu_bootable,
+       .cpu_bootable   = smp_generic_cpu_bootable,
 };
 
 /* This is called very early */
index 62ef21afb89a8a56189aa6638ee7a0483f6f64b0..a563a8aaf8122381682b419b1306f1a7f64db692 100644 (file)
@@ -17,7 +17,6 @@ extern void scom_init_wsp(void);
 extern void a2_setup_smp(void);
 extern int a2_scom_startup_cpu(unsigned int lcpu, int thr_idx,
                               struct device_node *np);
-extern int smp_a2_cpu_bootable(unsigned int nr);
 extern int smp_a2_kick_cpu(int nr);
 
 extern void opb_pic_init(void);