meson32: fix m8b cpu hotplug crash issue
authorYan Wang <yan.wang@amlogic.com>
Fri, 31 Mar 2017 08:00:59 +0000 (16:00 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Wed, 5 Apr 2017 01:44:24 +0000 (18:44 -0700)
PD#141217: fix m8b cpu hotplug crash issue

Change-Id: I7a80785a37a9ed4ab05f25cdc5ba43deba83d74c
Signed-off-by: Yan Wang <yan.wang@amlogic.com>
arch/arm/mach-meson/hotplug-asm.S
arch/arm/mach-meson/platsmp.c

index bf8628c..1871afa 100644 (file)
@@ -41,34 +41,13 @@ ENTRY(meson_cleanup)
        mrc p15, 0, r4, c1, c0, 0
        bic r4, r4, #(CR_I)
        mcr p15, 0, r4, c1, c0, 0
-
-       @ invalid i-cache
-       mov r4, #0
-       mcr p15, 0, r4, c7, c5, 6 @invalid BTAC
-       mcr p15, 0, r4, c7, c5, 0 @invalid icache
-       dsb
-       nop
-       nop
-       isb
-
-       @ dcache disable
-       mrc p15, 0, r4, c1, c0, 0
-       bic r4, r4, #CR_C
-       mcr p15, 0, r4, c1, c0, 0
-       dsb
        isb
 
-       /* Flush the D-cache */
-       bl      v7_flush_dcache_louis
-
-       mov r4, #0
-       mcr p15, 0, r4, c7, c10, 4
-       dsb
+       @ invalidate I-cache inner shareable
+       mov     r0, #0
+       mcr     p15, 0, r0, c7, c1, 0
        isb
 
-       /* Turn off coherency */
-       exit_smp r4, r5
-
        ldmfd   sp!, {r0-r11, pc}
 ENDPROC(meson_cleanup)
 
index 54e5fb0..ee6e112 100644 (file)
@@ -30,6 +30,9 @@
 #include <asm/mach-types.h>
 #include <linux/percpu.h>
 #include "platsmp.h"
+#include <asm/cache.h>
+#include <asm/cacheflush.h>
+#include <asm/cp15.h>
 
 static DEFINE_SPINLOCK(boot_lock);
 static DEFINE_SPINLOCK(clockfw_lock);
@@ -298,15 +301,13 @@ int meson_cpu_kill(unsigned int cpu)
        return 1;
 }
 
-
 void meson_cpu_die(unsigned int cpu)
 {
        meson_set_cpu_ctrl_reg(cpu, 0);
-       flush_cache_all();
-       dsb();
-       dmb();
 
        meson_cleanup();
+       v7_exit_coherency_flush(louis);
+
        aml_set_reg32_bits(CPU_POWER_CTRL_REG, 0x3, (cpu << 3), 2);
        asm volatile(
                "dsb\n"