lkml.org 
[lkml]   [2012]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 09/27] m32r, smpboot: Use generic SMP booting infrastructure
    Date
    Convert m32r to use the generic framework to boot secondary CPUs.

    Notes:
    Postpone enabling interrupts to after booting the secondary CPU fully.

    Cc: Hirokazu Takata <takata@linux-m32r.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: linux-m32r@ml.linux-m32r.org
    Cc: linux-m32r-ja@ml.linux-m32r.org
    Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
    ---

    arch/m32r/kernel/smpboot.c | 46 ++++++++++++++++++++++----------------------
    1 files changed, 23 insertions(+), 23 deletions(-)

    diff --git a/arch/m32r/kernel/smpboot.c b/arch/m32r/kernel/smpboot.c
    index 6ddc51a..cf3fc0c 100644
    --- a/arch/m32r/kernel/smpboot.c
    +++ b/arch/m32r/kernel/smpboot.c
    @@ -49,6 +49,7 @@
    #include <linux/irq.h>
    #include <linux/bootmem.h>
    #include <linux/delay.h>
    +#include <linux/smpboot.h>

    #include <asm/io.h>
    #include <asm/pgalloc.h>
    @@ -114,7 +115,6 @@ static void do_boot_cpu(int);

    int start_secondary(void *);
    static void smp_callin(void);
    -static void smp_online(void);

    static void show_mp_info(int);
    static void smp_store_cpu_info(int);
    @@ -418,22 +418,38 @@ void __init smp_cpus_done(unsigned int max_cpus)
    *==========================================================================*/
    int __init start_secondary(void *unused)
    {
    + smpboot_start_secondary(unused);
    + return 0;
    +}
    +
    +void __cpuinit __cpu_pre_starting(void *unused)
    +{
    + unsigned int cpu;
    +
    cpu_init();
    - preempt_disable();
    smp_callin();
    - while (!cpumask_test_cpu(smp_processor_id(), &smp_commenced_mask))
    +
    + cpu = smp_processor_id();
    + while (!cpumask_test_cpu(cpu, &smp_commenced_mask))
    cpu_relax();
    +}

    - smp_online();
    +void __cpuinit __cpu_pre_online(void *unused)
    +{
    + /* Get our bogomips. */
    + calibrate_delay();

    + /* Save our processor parameters */
    + smp_store_cpu_info(smp_processor_id());
    +}
    +
    +void __cpuinit __cpu_post_online(void *unused)
    +{
    /*
    * low-memory mappings have been cleared, flush them from
    * the local TLBs too.
    */
    local_flush_tlb_all();
    -
    - cpu_idle();
    - return 0;
    }

    /*==========================================================================*
    @@ -485,22 +501,6 @@ static void __init smp_callin(void)
    cpumask_set_cpu(cpu_id, &cpu_callin_map);
    }

    -static void __init smp_online(void)
    -{
    - int cpu_id = smp_processor_id();
    -
    - notify_cpu_starting(cpu_id);
    -
    - local_irq_enable();
    -
    - /* Get our bogomips. */
    - calibrate_delay();
    -
    - /* Save our processor parameters */
    - smp_store_cpu_info(cpu_id);
    -
    - set_cpu_online(cpu_id, true);
    -}

    /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
    /* Boot up CPUs common Routines */


    \
     
     \ /
      Last update: 2012-06-01 12:01    [W:0.038 / U:0.196 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site