Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-block.git] / drivers / cpuidle / cpuidle-powernv.c
index 1e3ef5ec4784dcfc3b758a0d67cac25c0d33e4ba..845bafcfa7929fd66cbb5eb966b16e0f3320de7f 100644 (file)
@@ -67,6 +67,8 @@ static int nap_loop(struct cpuidle_device *dev,
        return index;
 }
 
+/* Register for fastsleep only in oneshot mode of broadcast */
+#ifdef CONFIG_TICK_ONESHOT
 static int fastsleep_loop(struct cpuidle_device *dev,
                                struct cpuidle_driver *drv,
                                int index)
@@ -90,7 +92,7 @@ static int fastsleep_loop(struct cpuidle_device *dev,
 
        return index;
 }
-
+#endif
 /*
  * States for dedicated partition case.
  */
@@ -216,7 +218,14 @@ static int powernv_add_idle_states(void)
                        powernv_states[nr_idle_states].flags = 0;
                        powernv_states[nr_idle_states].target_residency = 100;
                        powernv_states[nr_idle_states].enter = &nap_loop;
-               } else if (flags[i] & OPAL_PM_SLEEP_ENABLED ||
+               }
+
+               /*
+                * All cpuidle states with CPUIDLE_FLAG_TIMER_STOP set must come
+                * within this config dependency check.
+                */
+#ifdef CONFIG_TICK_ONESHOT
+               if (flags[i] & OPAL_PM_SLEEP_ENABLED ||
                        flags[i] & OPAL_PM_SLEEP_ENABLED_ER1) {
                        /* Add FASTSLEEP state */
                        strcpy(powernv_states[nr_idle_states].name, "FastSleep");
@@ -225,7 +234,7 @@ static int powernv_add_idle_states(void)
                        powernv_states[nr_idle_states].target_residency = 300000;
                        powernv_states[nr_idle_states].enter = &fastsleep_loop;
                }
-
+#endif
                powernv_states[nr_idle_states].exit_latency =
                                ((unsigned int)latency_ns[i]) / 1000;