Commit 0e0ba769 authored by Catalin Marinas's avatar Catalin Marinas Committed by Russell King

[ARM] 4201/1: SMP barriers pair needed for the secondary boot process

In some situations, the pen_release store in platform_secondary_init()
may stay forever in the write buffer while the CPU is waiting on the
boot_lock to be released in boot_secondary(). The primary CPU could
never see the pen_release update without the barriers.
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 7770bddb
...@@ -59,6 +59,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu) ...@@ -59,6 +59,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
* pen, then head off into the C entry point * pen, then head off into the C entry point
*/ */
pen_release = -1; pen_release = -1;
smp_wmb();
/* /*
* Synchronise with the boot thread. * Synchronise with the boot thread.
...@@ -102,6 +103,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) ...@@ -102,6 +103,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
timeout = jiffies + (1 * HZ); timeout = jiffies + (1 * HZ);
while (time_before(jiffies, timeout)) { while (time_before(jiffies, timeout)) {
smp_rmb();
if (pen_release == -1) if (pen_release == -1)
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment