diff options
author | Sundar R Iyer <sundar.iyer@stericsson.com> | 2010-02-09 15:52:26 +0530 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-05-22 10:59:41 +0200 |
commit | 17ef9643d378f3c12ec33a2040e2e3b394db3133 (patch) | |
tree | 12b74f63f541cf37e1b350843e529e611de57c7f /arch/arm/kernel | |
parent | 7ef0b5717dd7edcae9f2602cc69e48cf148ec87f (diff) |
ARM : handle preempt count in cpu_idle
Signed-off-by: Sundar R Iyer <sundar.iyer@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r-- | arch/arm/kernel/process.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 2b7b017a20c..5b644d3e831 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c @@ -212,8 +212,17 @@ void cpu_idle(void) leds_event(led_idle_start); while (!need_resched()) { #ifdef CONFIG_HOTPLUG_CPU - if (cpu_is_offline(smp_processor_id())) + if (cpu_is_offline(smp_processor_id())) { + + /* NOTE : preempt_count() should be 0 for dying CPU + * as the CPU will use this very thread when + * it is alive + */ + if (preempt_count()) + preempt_enable_no_resched(); + cpu_die(); + } #endif /* |