]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - kernel/sched/idle.c
Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[karo-tx-linux.git] / kernel / sched / idle.c
index 2489140a7c515d474db8213c6c91e581992ffcc2..bd12c6c714ecea0718565df4539304e3bf9d9e57 100644 (file)
@@ -4,6 +4,7 @@
 #include <linux/sched.h>
 #include <linux/cpu.h>
 #include <linux/cpuidle.h>
+#include <linux/cpuhotplug.h>
 #include <linux/tick.h>
 #include <linux/mm.h>
 #include <linux/stackprotector.h>
@@ -97,12 +98,6 @@ void default_idle_call(void)
 static int call_cpuidle(struct cpuidle_driver *drv, struct cpuidle_device *dev,
                      int next_state)
 {
-       /* Fall back to the default arch idle method on errors. */
-       if (next_state < 0) {
-               default_idle_call();
-               return next_state;
-       }
-
        /*
         * The idle task must be scheduled, it is pointless to go to idle, just
         * update no idle residency and return.
@@ -168,7 +163,7 @@ static void cpuidle_idle_call(void)
         */
        if (idle_should_freeze()) {
                entered_state = cpuidle_enter_freeze(drv, dev);
-               if (entered_state >= 0) {
+               if (entered_state > 0) {
                        local_irq_enable();
                        goto exit_idle;
                }
@@ -199,8 +194,6 @@ exit_idle:
        rcu_idle_exit();
 }
 
-DEFINE_PER_CPU(bool, cpu_dead_idle);
-
 /*
  * Generic idle loop implementation
  *
@@ -227,10 +220,7 @@ static void cpu_idle_loop(void)
                        rmb();
 
                        if (cpu_is_offline(smp_processor_id())) {
-                               rcu_cpu_notify(NULL, CPU_DYING_IDLE,
-                                              (void *)(long)smp_processor_id());
-                               smp_mb(); /* all activity before dead. */
-                               this_cpu_write(cpu_dead_idle, true);
+                               cpuhp_report_idle_dead();
                                arch_cpu_idle_dead();
                        }
 
@@ -297,5 +287,6 @@ void cpu_startup_entry(enum cpuhp_state state)
        boot_init_stack_canary();
 #endif
        arch_cpu_idle_prepare();
+       cpuhp_online_idle(state);
        cpu_idle_loop();
 }