arc: Use generic idle loop
authorThomas Gleixner <tglx@linutronix.de>
Thu, 21 Mar 2013 21:49:36 +0000 (22:49 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 8 Apr 2013 15:39:23 +0000 (17:39 +0200)
The generic idle loop implements all functionality. Aside of that it
allows arc to implement the tsk_is_polling() functionality correctly,
despite the patently (now gone) comment in the original arc cpu_idle()
function:
/* Since we SLEEP in idle loop, TIF_POLLING_NRFLAG can't be set */
See kernel/cpu/idle.c

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Reviewed-by: Cc: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Magnus Damm <magnus.damm@gmail.com>
Acked-by: Vineet Gupta <vgupta@synopsys.com>
Tested-by: Vineet Gupta <vgupta@synopsys.com>
Link: http://lkml.kernel.org/r/20130321215233.711253792@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/arc/Kconfig
arch/arc/kernel/process.c
arch/arc/kernel/smp.c

index e6f4eca09ee36f5cbbe9ade6aadf07aa17ef6332..b006977a15162b37d1cd45abe5a2643dd7e7fb4e 100644 (file)
@@ -14,6 +14,7 @@ config ARC
        select GENERIC_ATOMIC64
        select GENERIC_CLOCKEVENTS
        select GENERIC_FIND_FIRST_BIT
+       select GENERIC_IDLE_LOOP
        # for now, we don't need GENERIC_IRQ_PROBE, CONFIG_GENERIC_IRQ_CHIP
        select GENERIC_IRQ_SHOW
        select GENERIC_KERNEL_EXECVE
index 0a7531d992945f5026c8aa747a61f58b6c12a54c..cad66851e0c4e67eb35bc5bbb3e4b6ec4b8f4929 100644 (file)
@@ -41,37 +41,12 @@ SYSCALL_DEFINE0(arc_gettls)
        return task_thread_info(current)->thr_ptr;
 }
 
-static inline void arch_idle(void)
+void arch_cpu_idle(void)
 {
        /* sleep, but enable all interrupts before committing */
        __asm__("sleep 0x3");
 }
 
-void cpu_idle(void)
-{
-       /* Since we SLEEP in idle loop, TIF_POLLING_NRFLAG can't be set */
-
-       /* endless idle loop with no priority at all */
-       while (1) {
-               tick_nohz_idle_enter();
-               rcu_idle_enter();
-
-doze:
-               local_irq_disable();
-               if (!need_resched()) {
-                       arch_idle();
-                       goto doze;
-               } else {
-                       local_irq_enable();
-               }
-
-               rcu_idle_exit();
-               tick_nohz_idle_exit();
-
-               schedule_preempt_disabled();
-       }
-}
-
 asmlinkage void ret_from_fork(void);
 
 /* Layout of Child kernel mode stack as setup at the end of this function is
index 3af3e06dcf028cc75b3998560ea58da37fb0bb85..5c7fd603d216c7bd8e0938074f32349358b6b84e 100644 (file)
@@ -141,7 +141,7 @@ void __cpuinit start_kernel_secondary(void)
 
        local_irq_enable();
        preempt_disable();
-       cpu_idle();
+       cpu_startup_entry(CPUHP_ONLINE);
 }
 
 /*