From 50c7960a4517d6c93226351cd8c43c86f104c919 Mon Sep 17 00:00:00 2001 From: Soren Brinkmann Date: Tue, 2 Sep 2014 14:19:12 -0700 Subject: ARM: zynq: Synchronise zynq_cpu_die/kill Avoid races and add synchronisation between the arch specific kill and die routines. The same synchronisation issue was fixed on IMX platform by this commit: "ARM: imx: fix sync issue between imx_cpu_die and imx_cpu_kill" (sha1: 2f3edfd7e27ad4206acbc2ae99c9df5f46353024) Signed-off-by: Soren Brinkmann Signed-off-by: Michal Simek --- arch/arm/mach-zynq/platsmp.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'arch/arm/mach-zynq/platsmp.c') diff --git a/arch/arm/mach-zynq/platsmp.c b/arch/arm/mach-zynq/platsmp.c index 6c7843108c7f..06415eeba7e6 100644 --- a/arch/arm/mach-zynq/platsmp.c +++ b/arch/arm/mach-zynq/platsmp.c @@ -127,6 +127,12 @@ static void zynq_secondary_init(unsigned int cpu) #ifdef CONFIG_HOTPLUG_CPU static int zynq_cpu_kill(unsigned cpu) { + unsigned long timeout = jiffies + msecs_to_jiffies(50); + + while (zynq_slcr_cpu_state_read(cpu)) + if (time_after(jiffies, timeout)) + return 0; + zynq_slcr_cpu_stop(cpu); return 1; } -- cgit