diff options
| author | Ralf Baechle <ralf@linux-mips.org> | 2009-06-23 05:00:31 -0400 |
|---|---|---|
| committer | Ralf Baechle <ralf@linux-mips.org> | 2009-06-24 13:34:40 -0400 |
| commit | 1b2bc75c1bde6581d2694cb3ed7fb06b69685008 (patch) | |
| tree | 800fc23052bccb1fbf8acfbaabbf5648c69daa9e /arch/mips/kernel/process.c | |
| parent | 4ac4aa5cc3b00cc558575065ae71043e92d1a69a (diff) | |
MIPS: Add arch generic CPU hotplug
Each platform has to add support for CPU hotplugging itself by providing
suitable definitions for the cpu_disable and cpu_die of the smp_ops
methods and setting SYS_SUPPORTS_HOTPLUG_CPU. A platform should only set
SYS_SUPPORTS_HOTPLUG_CPU once all it's smp_ops definitions have the
necessary changes. This patch contains the changes to the dummy smp_ops
definition for uni-processor systems.
Parts of the code contributed by Cavium Inc.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/process.c')
| -rw-r--r-- | arch/mips/kernel/process.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index 1eaaa450e20c..c09d681b7181 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c | |||
| @@ -50,10 +50,15 @@ | |||
| 50 | */ | 50 | */ |
| 51 | void __noreturn cpu_idle(void) | 51 | void __noreturn cpu_idle(void) |
| 52 | { | 52 | { |
| 53 | int cpu; | ||
| 54 | |||
| 55 | /* CPU is going idle. */ | ||
| 56 | cpu = smp_processor_id(); | ||
| 57 | |||
| 53 | /* endless idle loop with no priority at all */ | 58 | /* endless idle loop with no priority at all */ |
| 54 | while (1) { | 59 | while (1) { |
| 55 | tick_nohz_stop_sched_tick(1); | 60 | tick_nohz_stop_sched_tick(1); |
| 56 | while (!need_resched()) { | 61 | while (!need_resched() && cpu_online(cpu)) { |
| 57 | #ifdef CONFIG_MIPS_MT_SMTC | 62 | #ifdef CONFIG_MIPS_MT_SMTC |
| 58 | extern void smtc_idle_loop_hook(void); | 63 | extern void smtc_idle_loop_hook(void); |
| 59 | 64 | ||
| @@ -62,6 +67,12 @@ void __noreturn cpu_idle(void) | |||
| 62 | if (cpu_wait) | 67 | if (cpu_wait) |
| 63 | (*cpu_wait)(); | 68 | (*cpu_wait)(); |
| 64 | } | 69 | } |
| 70 | #ifdef CONFIG_HOTPLUG_CPU | ||
| 71 | if (!cpu_online(cpu) && !cpu_isset(cpu, cpu_callin_map) && | ||
| 72 | (system_state == SYSTEM_RUNNING || | ||
| 73 | system_state == SYSTEM_BOOTING)) | ||
| 74 | play_dead(); | ||
| 75 | #endif | ||
| 65 | tick_nohz_restart_sched_tick(); | 76 | tick_nohz_restart_sched_tick(); |
| 66 | preempt_enable_no_resched(); | 77 | preempt_enable_no_resched(); |
| 67 | schedule(); | 78 | schedule(); |
