Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 225884
b: refs/heads/master
c: 3c030be
h: refs/heads/master
v: v3
  • Loading branch information
Russell King committed Dec 20, 2010
1 parent 09ceec7 commit db73c62
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 36 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: 2c0136dba4e43b0916ccc9ecc7f11e6d6b73f046
refs/heads/master: 3c030beabf937b1d3b4ecaedfd1fb2f1e2aa0c70
14 changes: 13 additions & 1 deletion trunk/arch/arm/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <linux/irq.h>
#include <linux/percpu.h>
#include <linux/clockchips.h>
#include <linux/completion.h>

#include <asm/atomic.h>
#include <asm/cacheflush.h>
Expand Down Expand Up @@ -238,12 +239,20 @@ int __cpu_disable(void)
return 0;
}

static DECLARE_COMPLETION(cpu_died);

/*
* called on the thread which is asking for a CPU to be shutdown -
* waits until shutdown has completed, or it is timed out.
*/
void __cpu_die(unsigned int cpu)
{
if (!wait_for_completion_timeout(&cpu_died, msecs_to_jiffies(5000))) {
pr_err("CPU%u: cpu didn't die\n", cpu);
return;
}
printk(KERN_NOTICE "CPU%u: shutdown\n", cpu);

if (!platform_cpu_kill(cpu))
printk("CPU%u: unable to kill\n", cpu);
}
Expand All @@ -263,9 +272,12 @@ void __ref cpu_die(void)
local_irq_disable();
idle_task_exit();

/* Tell __cpu_die() that this CPU is now safe to dispose of */
complete(&cpu_died);

/*
* actual CPU shutdown procedure is at least platform (if not
* CPU) specific
* CPU) specific.
*/
platform_cpu_die(cpu);

Expand Down
8 changes: 2 additions & 6 deletions trunk/arch/arm/mach-omap2/omap-hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/smp.h>
#include <linux/completion.h>

#include <asm/cacheflush.h>
#include <mach/omap4-common.h>

static DECLARE_COMPLETION(cpu_killed);

int platform_cpu_kill(unsigned int cpu)
{
return wait_for_completion_timeout(&cpu_killed, 5000);
return 1;
}

/*
Expand All @@ -42,8 +39,7 @@ void platform_cpu_die(unsigned int cpu)
this_cpu, cpu);
BUG();
}
pr_notice("CPU%u: shutdown\n", cpu);
complete(&cpu_killed);

flush_cache_all();
dsb();

Expand Down
8 changes: 1 addition & 7 deletions trunk/arch/arm/mach-realview/hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/smp.h>
#include <linux/completion.h>

#include <asm/cacheflush.h>

extern volatile int pen_release;

static DECLARE_COMPLETION(cpu_killed);

static inline void cpu_enter_lowpower(void)
{
unsigned int v;
Expand Down Expand Up @@ -95,7 +92,7 @@ static inline void platform_do_lowpower(unsigned int cpu)

int platform_cpu_kill(unsigned int cpu)
{
return wait_for_completion_timeout(&cpu_killed, 5000);
return 1;
}

/*
Expand All @@ -115,9 +112,6 @@ void platform_cpu_die(unsigned int cpu)
}
#endif

printk(KERN_NOTICE "CPU%u: shutdown\n", cpu);
complete(&cpu_killed);

/*
* we're ready for shutdown now, so do it
*/
Expand Down
8 changes: 1 addition & 7 deletions trunk/arch/arm/mach-s5pv310/hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/smp.h>
#include <linux/completion.h>

#include <asm/cacheflush.h>

extern volatile int pen_release;

static DECLARE_COMPLETION(cpu_killed);

static inline void cpu_enter_lowpower(void)
{
unsigned int v;
Expand Down Expand Up @@ -98,7 +95,7 @@ static inline void platform_do_lowpower(unsigned int cpu)

int platform_cpu_kill(unsigned int cpu)
{
return wait_for_completion_timeout(&cpu_killed, 5000);
return 1;
}

/*
Expand All @@ -118,9 +115,6 @@ void platform_cpu_die(unsigned int cpu)
}
#endif

printk(KERN_NOTICE "CPU%u: shutdown\n", cpu);
complete(&cpu_killed);

/*
* we're ready for shutdown now, so do it
*/
Expand Down
8 changes: 1 addition & 7 deletions trunk/arch/arm/mach-tegra/hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/smp.h>
#include <linux/completion.h>

#include <asm/cacheflush.h>

static DECLARE_COMPLETION(cpu_killed);

static inline void cpu_enter_lowpower(void)
{
unsigned int v;
Expand Down Expand Up @@ -94,7 +91,7 @@ static inline void platform_do_lowpower(unsigned int cpu)

int platform_cpu_kill(unsigned int cpu)
{
return wait_for_completion_timeout(&cpu_killed, 5000);
return 1;
}

/*
Expand All @@ -114,9 +111,6 @@ void platform_cpu_die(unsigned int cpu)
}
#endif

printk(KERN_NOTICE "CPU%u: shutdown\n", cpu);
complete(&cpu_killed);

/*
* we're ready for shutdown now, so do it
*/
Expand Down
8 changes: 1 addition & 7 deletions trunk/arch/arm/mach-ux500/hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/smp.h>
#include <linux/completion.h>

#include <asm/cacheflush.h>

extern volatile int pen_release;

static DECLARE_COMPLETION(cpu_killed);

static inline void platform_do_lowpower(unsigned int cpu)
{
flush_cache_all();
Expand All @@ -38,7 +35,7 @@ static inline void platform_do_lowpower(unsigned int cpu)

int platform_cpu_kill(unsigned int cpu)
{
return wait_for_completion_timeout(&cpu_killed, 5000);
return 1;
}

/*
Expand All @@ -58,9 +55,6 @@ void platform_cpu_die(unsigned int cpu)
}
#endif

printk(KERN_NOTICE "CPU%u: shutdown\n", cpu);
complete(&cpu_killed);

/* directly enter low power state, skipping secure registers */
platform_do_lowpower(cpu);
}
Expand Down

0 comments on commit db73c62

Please sign in to comment.