]> git.karo-electronics.de Git - linux-beck.git/commitdiff
arm64: Use generic idle loop
authorThomas Gleixner <tglx@linutronix.de>
Thu, 21 Mar 2013 21:49:39 +0000 (22:49 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 8 Apr 2013 15:39:24 +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: Catalin Marinas <catalin.marinas@arm.com>
Link: http://lkml.kernel.org/r/20130321215233.887563095@linutronix.de
arch/arm64/Kconfig
arch/arm64/kernel/process.c
arch/arm64/kernel/smp.c

index 9b6d19f74078e0a2118e6fbd1c517e5f4f82203c..ca2c871795c551e21e3400e250a22dc46a98a77b 100644 (file)
@@ -9,6 +9,7 @@ config ARM64
        select CLONE_BACKWARDS
        select COMMON_CLK
        select GENERIC_CLOCKEVENTS
+       select GENERIC_IDLE_LOOP
        select GENERIC_IOMAP
        select GENERIC_IRQ_PROBE
        select GENERIC_IRQ_SHOW
index 0337cdb0667b0128a8c6d9aeb141cacbffbff054..83a0ad5936a53e2c8a4d4c9a6b329da2505fc55a 100644 (file)
@@ -84,11 +84,15 @@ EXPORT_SYMBOL_GPL(pm_power_off);
 void (*pm_restart)(const char *cmd);
 EXPORT_SYMBOL_GPL(pm_restart);
 
+void arch_cpu_idle_prepare(void)
+{
+       local_fiq_enable();
+}
 
 /*
  * This is our default idle handler.
  */
-static void default_idle(void)
+void arch_cpu_idle(void)
 {
        /*
         * This should do all the clock switching and wait for interrupt
@@ -98,43 +102,6 @@ static void default_idle(void)
        local_irq_enable();
 }
 
-/*
- * The idle thread.
- * We always respect 'hlt_counter' to prevent low power idle.
- */
-void cpu_idle(void)
-{
-       local_fiq_enable();
-
-       /* endless idle loop with no priority at all */
-       while (1) {
-               tick_nohz_idle_enter();
-               rcu_idle_enter();
-               while (!need_resched()) {
-                       /*
-                        * We need to disable interrupts here to ensure
-                        * we don't miss a wakeup call.
-                        */
-                       local_irq_disable();
-                       if (!need_resched()) {
-                               stop_critical_timings();
-                               default_idle();
-                               start_critical_timings();
-                               /*
-                                * default_idle functions should always return
-                                * with IRQs enabled.
-                                */
-                               WARN_ON(irqs_disabled());
-                       } else {
-                               local_irq_enable();
-                       }
-               }
-               rcu_idle_exit();
-               tick_nohz_idle_exit();
-               schedule_preempt_disabled();
-       }
-}
-
 void machine_shutdown(void)
 {
 #ifdef CONFIG_SMP
index bdd34597254bb7a5f08d91b6e09df1f86adfcbb6..261445c4666f62e19135b5b7f38dd20770c3fc7e 100644 (file)
@@ -216,7 +216,7 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
        /*
         * OK, it's off to the idle thread for us
         */
-       cpu_idle();
+       cpu_startup_entry(CPUHP_ONLINE);
 }
 
 void __init smp_cpus_done(unsigned int max_cpus)