sparc32,leon: SMP power down implementation
authorDaniel Hellstrom <daniel@gaisler.com>
Mon, 25 Apr 2011 21:48:17 +0000 (21:48 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 May 2011 20:03:28 +0000 (13:03 -0700)
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/kernel/process_32.c

index 17529298c50a2e283ede3342830747fe54641384..c8cc461ff75f040a974179aa7383ba501dde017a 100644 (file)
@@ -128,8 +128,16 @@ void cpu_idle(void)
         set_thread_flag(TIF_POLLING_NRFLAG);
        /* endless idle loop with no priority at all */
        while(1) {
-               while (!need_resched())
-                       cpu_relax();
+#ifdef CONFIG_SPARC_LEON
+               if (pm_idle) {
+                       while (!need_resched())
+                               (*pm_idle)();
+               } else
+#endif
+               {
+                       while (!need_resched())
+                               cpu_relax();
+               }
                preempt_enable_no_resched();
                schedule();
                preempt_disable();