Initial SPH-L710 JB Source
/arch/arm/kernel/smp.c
blob:07929831677065bda3ee51eb40ecae90574156da -> blob:76b4b0958e085c43408f62c80c53b98647b2cb09
--- arch/arm/kernel/smp.c
+++ arch/arm/kernel/smp.c
@@ -289,6 +289,10 @@ static void __cpuinit smp_store_cpu_info
struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpuid);
cpu_info->loops_per_jiffy = loops_per_jiffy;
+
+#ifdef CONFIG_ARM_CPU_TOPOLOGY
+store_cpu_topology(cpuid);
+#endif
}
/*
@@ -312,20 +316,28 @@ static inline int skip_secondary_calibra
asmlinkage void __cpuinit secondary_start_kernel(void)
{
struct mm_struct *mm = &init_mm;
- unsigned int cpu = smp_processor_id();
+ unsigned int cpu;
pr_debug("CPU%u: Booted secondary processor\n", cpu);
/*
+ * The identity mapping is uncached (strongly ordered), so
+ * switch away from it before attempting any exclusive accesses.
+ */
+ cpu_switch_mm(mm->pgd, mm);
+ enter_lazy_tlb(mm, current);
+ local_flush_tlb_all();
+
+ /*
* All kernel threads share the same mm context; grab a
* reference and switch to it.
*/
+ cpu = smp_processor_id();
atomic_inc(&mm->mm_count);
current->active_mm = mm;
cpumask_set_cpu(cpu, mm_cpumask(mm));
- cpu_switch_mm(mm->pgd, mm);
- enter_lazy_tlb(mm, current);
- local_flush_tlb_all();
+
+ printk("CPU%u: Booted secondary processor\n", cpu);
cpu_init();
preempt_disable();
@@ -336,9 +348,6 @@ asmlinkage void __cpuinit secondary_star
*/
platform_secondary_init(cpu);
- /*
- * Enable local interrupts.
- */
notify_cpu_starting(cpu);
if (skip_secondary_calibrate())
@@ -375,7 +384,7 @@ void __init smp_cpus_done(unsigned int m
for_each_online_cpu(cpu)
bogosum += per_cpu(cpu_data, cpu).loops_per_jiffy;
- printk(KERN_INFO "SMP: Total of %d processors activated "
+ printk(KERN_INFO "[AnthraX-SMP]: Total of %d processors activated "
"(%lu.%02lu BogoMIPS).\n",
num_online_cpus(),
bogosum / (500000/HZ),
@@ -392,7 +401,9 @@ void __init smp_prepare_boot_cpu(void)
void __init smp_prepare_cpus(unsigned int max_cpus)
{
unsigned int ncores = num_possible_cpus();
-
+#ifdef CONFIG_ARM_CPU_TOPOLOGY
+ init_cpu_topology();
+#endif
smp_store_cpu_info(smp_processor_id());
/*
@@ -549,9 +560,9 @@ static void ipi_cpu_stop(unsigned int cp
raw_spin_lock(&stop_lock);
printk(KERN_CRIT "CPU%u: stopping\n", cpu);
dump_stack();
-#if CONFIG_SEC_DEBUG
+/*#if CONFIG_SEC_DEBUG
sec_debug_dump_stack();
-#endif
+#endif*/
raw_spin_unlock(&stop_lock);
}
@@ -657,7 +668,9 @@ void handle_IPI(int ipinr, struct pt_reg
break;
case IPI_CPU_BACKTRACE:
+ irq_enter();
ipi_cpu_backtrace(cpu, regs);
+ irq_exit();
break;
default: