Set preempt_count of idle_thread to zero before switching off cpu.  Otherwise
the preempt_count will be wrong if the cpu is switched on again since the
thread will be reused.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
        __ctl_set_bit(8, 15);
 
 #ifdef CONFIG_HOTPLUG_CPU
-       if (cpu_is_offline(cpu))
+       if (cpu_is_offline(cpu)) {
+               preempt_enable_no_resched();
                cpu_die();
+       }
 #endif
 
        local_mcck_disable();