Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 297578
b: refs/heads/master
c: 149c241
h: refs/heads/master
v: v3
  • Loading branch information
Russell King committed Mar 24, 2012
1 parent 466e237 commit f0a612c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 94e5a85b3be0ce109d26aa6812b2a02c518a0e4b
refs/heads/master: 149c24151e8577b2a033639722dc5734de5e6eaf
17 changes: 6 additions & 11 deletions trunk/arch/arm/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ enum ipi_msg_type {
IPI_CPU_STOP,
};

static DECLARE_COMPLETION(cpu_running);

int __cpuinit __cpu_up(unsigned int cpu)
{
struct cpuinfo_arm *ci = &per_cpu(cpu_data, cpu);
Expand Down Expand Up @@ -98,20 +100,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);
Expand Down Expand Up @@ -300,9 +294,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.
Expand Down

0 comments on commit f0a612c

Please sign in to comment.