summary refs log tree commit diff
path: root/arch/arm/mach-rockchip
diff options
context:
space:
mode:
authorCaesar Wang <wxt@rock-chips.com>2015-06-09 17:49:58 +0800
committerHeiko Stuebner <heiko@sntech.de>2015-07-06 00:46:59 +0200
commite306bc16c53199e7440e1fee69dd91dc0a56edee (patch)
treef918e432d41d2b19e4aa2b096aeb900132ca6a4c /arch/arm/mach-rockchip
parentfe4407c0dc58215a7abfb7532740d79ddabe7a7a (diff)
downloadlinux-e306bc16c53199e7440e1fee69dd91dc0a56edee.tar.gz
ARM: rockchip: ensure CPU to enter WFI/WFE state
The patch can ensure that v7_exit_coherency_flush() in rockchip_cpu_die()
executed in time.
The mdelay(1) has enough time to fix the problem of CPU offlining.
That's a workaround way in rockchip hotplug code,
At least, we haven't a better way to solve it. Who know,
that maybe fixed by chip (hardware) in the future.

Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Diffstat (limited to 'arch/arm/mach-rockchip')
-rw-r--r--arch/arm/mach-rockchip/platsmp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/mach-rockchip/platsmp.c b/arch/arm/mach-rockchip/platsmp.c
index d1a5fec68887..4187ac2b01b3 100644
--- a/arch/arm/mach-rockchip/platsmp.c
+++ b/arch/arm/mach-rockchip/platsmp.c
@@ -321,6 +321,13 @@ static void __init rockchip_smp_prepare_cpus(unsigned int max_cpus)
 #ifdef CONFIG_HOTPLUG_CPU
 static int rockchip_cpu_kill(unsigned int cpu)
 {
+	/*
+	 * We need a delay here to ensure that the dying CPU can finish
+	 * executing v7_coherency_exit() and reach the WFI/WFE state
+	 * prior to having the power domain disabled.
+	 */
+	mdelay(1);
+
 	pmu_set_power_domain(0 + cpu, false);
 	return 1;
 }