summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/hotplug.c
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2013-01-14 07:08:50 +0100
committerShawn Guo <shawn.guo@linaro.org>2013-01-14 15:17:17 +0100
commit837576642167d701f983e4def0d3936b514a28ae (patch)
tree2f03e38dff819054b70eb3f499e6dab873bb4c96 /arch/arm/mach-imx/hotplug.c
parentvideo: imxfb: fix imxfb_info configuration order (diff)
downloadlinux-837576642167d701f983e4def0d3936b514a28ae.tar.xz
linux-837576642167d701f983e4def0d3936b514a28ae.zip
ARM: imx: disable cpu in .cpu_kill hook
It's buggy to disable the cpu that is being hot-unplugged in .cpu_die hook which runs on the cpu itself. Instead, it should be done in .cpu_kill which runs on the thread (another cpu) that asks for shutting down the cpu. Move imx_enable_cpu(cpu, false) call into .cpu_kill hook, and leave the cpu to be hot-unplugged in WFI within .cpu_die, so that we can get a more stable cpu hot-plug operation. Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm/mach-imx/hotplug.c')
-rw-r--r--arch/arm/mach-imx/hotplug.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/arm/mach-imx/hotplug.c b/arch/arm/mach-imx/hotplug.c
index 3dec962b0770..7bc5fe15dda2 100644
--- a/arch/arm/mach-imx/hotplug.c
+++ b/arch/arm/mach-imx/hotplug.c
@@ -46,9 +46,11 @@ static inline void cpu_enter_lowpower(void)
void imx_cpu_die(unsigned int cpu)
{
cpu_enter_lowpower();
- imx_enable_cpu(cpu, false);
+ cpu_do_idle();
+}
- /* spin here until hardware takes it down */
- while (1)
- ;
+int imx_cpu_kill(unsigned int cpu)
+{
+ imx_enable_cpu(cpu, false);
+ return 1;
}