]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/kernel/idle.c
[POWERPC] pci32: Remove PowerMac P2P bridge IO hack
[linux-2.6-omap-h63xx.git] / arch / powerpc / kernel / idle.c
index 8b27bb1a5b31a2a7723b0678bca591273cb1c4c4..c3cf0e8f3ac173332a01148946ace8c43f45a5a5 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/smp.h>
 #include <linux/cpu.h>
 #include <linux/sysctl.h>
+#include <linux/tick.h>
 
 #include <asm/system.h>
 #include <asm/processor.h>
 #include <asm/smp.h>
 
 #ifdef CONFIG_HOTPLUG_CPU
+/* this is used for software suspend, and that shuts down
+ * CPUs even while the system is still booting... */
 #define cpu_should_die()       (cpu_is_offline(smp_processor_id()) && \
-                                system_state == SYSTEM_RUNNING)
+                                  (system_state == SYSTEM_RUNNING     \
+                                || system_state == SYSTEM_BOOTING))
 #else
 #define cpu_should_die()       0
 #endif
@@ -56,6 +60,7 @@ void cpu_idle(void)
 
        set_thread_flag(TIF_POLLING_NRFLAG);
        while (1) {
+               tick_nohz_stop_sched_tick();
                while (!need_resched() && !cpu_should_die()) {
                        ppc64_runlatch_off();
 
@@ -87,6 +92,7 @@ void cpu_idle(void)
 
                HMT_medium();
                ppc64_runlatch_on();
+               tick_nohz_restart_sched_tick();
                if (cpu_should_die())
                        cpu_die();
                preempt_enable_no_resched();
@@ -116,7 +122,7 @@ static ctl_table powersave_nap_sysctl_root[] = {
        {
                .ctl_name       = CTL_KERN,
                .procname       = "kernel",
-               .mode           = 0755,
+               .mode           = 0555,
                .child          = powersave_nap_ctl_table,
        },
        {}
@@ -125,7 +131,7 @@ static ctl_table powersave_nap_sysctl_root[] = {
 static int __init
 register_powersave_nap_sysctl(void)
 {
-       register_sysctl_table(powersave_nap_sysctl_root, 0);
+       register_sysctl_table(powersave_nap_sysctl_root);
 
        return 0;
 }