cris: Use generic idle loop
authorThomas Gleixner <tglx@linutronix.de>
Thu, 21 Mar 2013 21:49:43 +0000 (22:49 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 8 Apr 2013 15:39:25 +0000 (17:39 +0200)
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: Jesper Nilsson <jesper.nilsson@axis.com>
Link: http://lkml.kernel.org/r/20130321215234.148829489@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/cris/Kconfig
arch/cris/arch-v10/kernel/process.c
arch/cris/arch-v32/kernel/process.c
arch/cris/arch-v32/kernel/smp.c
arch/cris/kernel/process.c

index 06dd026533e3b758b68091bc0a8c754b3084f0da..1dd36355a3cd2e17d9000e3fb5a36b2610808ac0 100644 (file)
@@ -48,6 +48,7 @@ config CRIS
        select GENERIC_IRQ_SHOW
        select GENERIC_IOMAP
        select GENERIC_SMP_IDLE_THREAD if ETRAX_ARCH_V32
+       select GENERIC_IDLE_LOOP
        select GENERIC_CMOS_UPDATE
        select MODULES_USE_ELF_RELA
        select CLONE_BACKWARDS2
index b1018750cffbdeeabb3c265d25ff4c0644482e9e..2ba23c13df683db209e04a4b46df0638cff04d37 100644 (file)
@@ -30,8 +30,9 @@ void etrax_gpio_wake_up_check(void); /* drivers/gpio.c */
 void default_idle(void)
 {
 #ifdef CONFIG_ETRAX_GPIO
-  etrax_gpio_wake_up_check();
+       etrax_gpio_wake_up_check();
 #endif
+       local_irq_enable();
 }
 
 /*
index 4857933d59f4eb27bda5b5b75c03b4fbb1bc0aba..57451faa9b20edb9bc98fd57e0b156308d33d693 100644 (file)
@@ -23,13 +23,9 @@ extern void stop_watchdog(void);
 /* We use this if we don't have any better idle routine. */
 void default_idle(void)
 {
-       local_irq_disable();
-       if (!need_resched()) {
-               /* Halt until exception. */
-               __asm__ volatile("ei    \n\t"
-                                "halt      ");
-       }
-       local_irq_enable();
+       /* Halt until exception. */
+       __asm__ volatile("ei    \n\t"
+                        "halt      ");
 }
 
 /*
index 04a16edd540162ae3c596cd7ee2c5dc7cffe0cf5..cdd12028de0c5254e1622b97a38e9d20e14c3095 100644 (file)
@@ -145,8 +145,6 @@ smp_boot_one_cpu(int cpuid, struct task_struct idle)
  * specific stuff such as the local timer and the MMU. */
 void __init smp_callin(void)
 {
-       extern void cpu_idle(void);
-
        int cpu = cpu_now_booting;
        reg_intr_vect_rw_mask vect_mask = {0};
 
@@ -170,7 +168,7 @@ void __init smp_callin(void)
        local_irq_enable();
 
        set_cpu_online(cpu, true);
-       cpu_idle();
+       cpu_startup_entry(CPUHP_ONLINE);
 }
 
 /* Stop execution on this CPU.*/
index 508c9cdacc7bf239ec14543b131de0d1c6735b3a..b78498eb079b14e2930208d963c5e9dd87f57a1f 100644 (file)
@@ -34,29 +34,9 @@ extern void default_idle(void);
 void (*pm_power_off)(void);
 EXPORT_SYMBOL(pm_power_off);
 
-/*
- * The idle thread. There's no useful work to be
- * done, so just try to conserve power and have a
- * low exit latency (ie sit in a loop waiting for
- * somebody to say that they'd like to reschedule)
- */
-
-void cpu_idle (void)
+void arch_cpu_idle(void)
 {
-       /* endless idle loop with no priority at all */
-       while (1) {
-               rcu_idle_enter();
-               while (!need_resched()) {
-                       /*
-                        * Mark this as an RCU critical section so that
-                        * synchronize_kernel() in the unload path waits
-                        * for our completion.
-                        */
-                       default_idle();
-               }
-               rcu_idle_exit();
-               schedule_preempt_disabled();
-       }
+       default_idle();
 }
 
 void hard_reset_now (void);