aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaio Schnepper <caioschnepper@gmail.com>2016-02-05 12:34:21 -0800
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-02-05 12:34:30 -0800
commit27e5503365652148d4c8b147043ccb638eaa1090 (patch)
tree9dfe429d9cbb7f5266f6f2d90997f8d3431f643f
parentc919e77581c5f10700b2b9de2e6a55d721bf12f7 (diff)
downloadkernel_samsung_smdk4412-27e5503365652148d4c8b147043ccb638eaa1090.zip
kernel_samsung_smdk4412-27e5503365652148d4c8b147043ccb638eaa1090.tar.gz
kernel_samsung_smdk4412-27e5503365652148d4c8b147043ccb638eaa1090.tar.bz2
Revert "Revert "ARM: SMP: use a timing out completion for cpu hotplug""
This reverts commit ab6a2b873f19b1fde020b339aab8b830ede31f74. Change-Id: I9eb51664151d6d3b94c70a323d927f6dc9d0d56f
-rw-r--r--arch/arm/kernel/smp.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 2364aa6..6f4ecfc 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -58,6 +58,8 @@ enum ipi_msg_type {
IPI_CPU_BACKTRACE,
};
+static DECLARE_COMPLETION(cpu_running);
+
int __cpuinit __cpu_up(unsigned int cpu)
{
struct cpuinfo_arm *ci = &per_cpu(cpu_data, cpu);
@@ -117,20 +119,12 @@ int __cpuinit __cpu_up(unsigned int cpu)
*/
ret = boot_secondary(cpu, idle);
if (ret == 0) {
- unsigned long timeout;
-
/*
* CPU was successfully started, wait for it
* to come online or time out.
*/
- timeout = jiffies + HZ;
- while (time_before(jiffies, timeout)) {
- if (cpu_online(cpu))
- break;
-
- udelay(10);
- barrier();
- }
+ wait_for_completion_timeout(&cpu_running,
+ msecs_to_jiffies(1000));
if (!cpu_online(cpu)) {
pr_crit("CPU%u: failed to come online\n", cpu);
@@ -336,9 +330,10 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
/*
* OK, now it's safe to let the boot CPU continue. Wait for
* the CPU migration code to notice that the CPU is online
- * before we continue.
+ * before we continue - which happens after __cpu_up returns.
*/
set_cpu_online(cpu, true);
+ complete(&cpu_running);
/*
* Setup the percpu timer for this CPU.