cpuidle: Remove CPUIDLE_FLAG_IGNORE and dev->prepare()
authorDeepthi Dharwar <deepthi@linux.vnet.ibm.com>
Fri, 28 Oct 2011 10:50:24 +0000 (16:20 +0530)
committerLen Brown <len.brown@intel.com>
Mon, 7 Nov 2011 02:13:43 +0000 (21:13 -0500)
The cpuidle_device->prepare() mechanism causes updates to the
cpuidle_state[].flags, setting and clearing CPUIDLE_FLAG_IGNORE
to tell the governor not to chose a state on a per-cpu basis at
run-time. State demotion is now handled by the driver and it returns
the actual state entered. Hence, this mechanism is not required.
Also this removes per-cpu flags from cpuidle_state enabling
it to be made global.

Reference:
https://lkml.org/lkml/2011/3/25/52

Signed-off-by: Deepthi Dharwar <deepthi@linux.vnet.ibm>
Signed-off-by: Trinabh Gupta <g.trinabh@gmail.com>
Tested-by: Jean Pihet <j-pihet@ti.com>
Acked-by: Arjan van de Ven <arjan@linux.intel.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/cpuidle/cpuidle.c
drivers/cpuidle/governors/menu.c
include/linux/cpuidle.h

index 88bd121043962cad5b8f2a54b0ee22fd0b73a512..f66bcf9bfe9369769ae199176eb96851748d4ed5 100644 (file)
@@ -83,16 +83,6 @@ int cpuidle_idle_call(void)
        hrtimer_peek_ahead_timers();
 #endif
 
-       /*
-        * Call the device's prepare function before calling the
-        * governor's select function.  ->prepare gives the device's
-        * cpuidle driver a chance to update any dynamic information
-        * of its cpuidle states for the current idle period, e.g.
-        * state availability, latencies, residencies, etc.
-        */
-       if (dev->prepare)
-               dev->prepare(dev);
-
        /* ask the governor for the next state */
        next_state = cpuidle_curr_governor->select(dev);
        if (need_resched()) {
index e4b200c5b441e2384dc2c0ee8bb3263f221c5f29..af724e823c8ee50775e06bf11a43453c3063c91f 100644 (file)
@@ -288,8 +288,6 @@ static int menu_select(struct cpuidle_device *dev)
        for (i = CPUIDLE_DRIVER_STATE_START; i < dev->state_count; i++) {
                struct cpuidle_state *s = &dev->states[i];
 
-               if (s->flags & CPUIDLE_FLAG_IGNORE)
-                       continue;
                if (s->target_residency > data->predicted_us)
                        continue;
                if (s->exit_latency > latency_req)
index 8da811bcdbdb3e40c76e2eb9384575a8ac2dc9ae..c6d85cf90eb2a4828f62c58c37f377dbd117365a 100644 (file)
@@ -47,7 +47,6 @@ struct cpuidle_state {
 
 /* Idle State Flags */
 #define CPUIDLE_FLAG_TIME_VALID        (0x01) /* is residency time measurable? */
-#define CPUIDLE_FLAG_IGNORE    (0x100) /* ignore during this idle period */
 
 #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000)
 
@@ -93,8 +92,6 @@ struct cpuidle_device {
        struct completion       kobj_unregister;
        void                    *governor_data;
        int                     safe_state_index;
-
-       int (*prepare)          (struct cpuidle_device *dev);
 };
 
 DECLARE_PER_CPU(struct cpuidle_device *, cpuidle_devices);