]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00275403 ARM: imx: Support CPU hotplug
authorAnson Huang <b20788@freescale.com>
Thu, 15 Aug 2013 20:18:22 +0000 (16:18 -0400)
committerJason Liu <r64343@freescale.com>
Wed, 30 Oct 2013 01:54:43 +0000 (09:54 +0800)
When doing secondary cores enable/disable, the enable bit
and reset bit in SRC should be written together. Without
this, CPU hotplug can NOT pass stress test, and with this,
it can passed over 500k iterations CPU hotplug test with
many threads running in background, at least three boards
are tested.

When trying hotplug a secondary core, it should stay
in idle forever before it is disabled from SRC.

Signed-off-by: Anson Huang <b20788@freescale.com>
arch/arm/mach-imx/hotplug.c
arch/arm/mach-imx/src.c

index 3daf1ed90579a74a97f4d25f4292d8d09e50a1f5..a40919b92255d353b3d116b23a61beb29d66e9b9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 Freescale Semiconductor, Inc.
+ * Copyright 2011, 2013 Freescale Semiconductor, Inc.
  * Copyright 2011 Linaro Ltd.
  *
  * The code contained herein is licensed under the GNU General Public
@@ -52,7 +52,8 @@ void imx_cpu_die(unsigned int cpu)
         * the register being cleared to kill the cpu.
         */
        imx_set_cpu_arg(cpu, ~0);
-       cpu_do_idle();
+       for (;;)
+               cpu_do_idle();
 }
 
 int imx_cpu_kill(unsigned int cpu)
index 10a6b1a8c5acee611c2ae0c74766866b70cffd67..9e589d9e0152c725255e59a6e2f421562b7f2ae1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 Freescale Semiconductor, Inc.
+ * Copyright 2011, 2013 Freescale Semiconductor, Inc.
  * Copyright 2011 Linaro Ltd.
  *
  * The code contained herein is licensed under the GNU General Public
@@ -91,6 +91,7 @@ void imx_enable_cpu(int cpu, bool enable)
        spin_lock(&scr_lock);
        val = readl_relaxed(src_base + SRC_SCR);
        val = enable ? val | mask : val & ~mask;
+       val |= 1 << (BP_SRC_SCR_CORE1_RST + cpu - 1);
        writel_relaxed(val, src_base + SRC_SCR);
        spin_unlock(&scr_lock);
 }