Merge master.kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6
[linux-drm-fsl-dcu.git] / arch / sparc64 / kernel / process.c
index b291060c25a642daf5d369a9a77cb594abf0903f..8e3c6e435110a2ae186f5d02bb5fbe720487e96a 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/kallsyms.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
-#include <linux/smp_lock.h>
 #include <linux/stddef.h>
 #include <linux/ptrace.h>
 #include <linux/slab.h>
@@ -28,6 +27,7 @@
 #include <linux/reboot.h>
 #include <linux/delay.h>
 #include <linux/compat.h>
+#include <linux/tick.h>
 #include <linux/init.h>
 
 #include <asm/oplib.h>
@@ -88,12 +88,14 @@ void cpu_idle(void)
        set_thread_flag(TIF_POLLING_NRFLAG);
 
        while(1) {
-               if (need_resched()) {
-                       preempt_enable_no_resched();
-                       schedule();
-                       preempt_disable();
-               }
-               sparc64_yield();
+               tick_nohz_stop_sched_tick();
+               while (!need_resched())
+                       sparc64_yield();
+               tick_nohz_restart_sched_tick();
+
+               preempt_enable_no_resched();
+               schedule();
+               preempt_disable();
        }
 }