aboutsummaryrefslogtreecommitdiffstats
path: root/patches.kzm9g/0043-cpuidle-Remove-CPUIDLE_FLAG_IGNORE-and-dev-prepare.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches.kzm9g/0043-cpuidle-Remove-CPUIDLE_FLAG_IGNORE-and-dev-prepare.patch')
-rw-r--r--patches.kzm9g/0043-cpuidle-Remove-CPUIDLE_FLAG_IGNORE-and-dev-prepare.patch89
1 files changed, 89 insertions, 0 deletions
diff --git a/patches.kzm9g/0043-cpuidle-Remove-CPUIDLE_FLAG_IGNORE-and-dev-prepare.patch b/patches.kzm9g/0043-cpuidle-Remove-CPUIDLE_FLAG_IGNORE-and-dev-prepare.patch
new file mode 100644
index 00000000000000..549d142a86ca94
--- /dev/null
+++ b/patches.kzm9g/0043-cpuidle-Remove-CPUIDLE_FLAG_IGNORE-and-dev-prepare.patch
@@ -0,0 +1,89 @@
+From bdf8107f9e58c5563946d7cb46e1bed307ce2653 Mon Sep 17 00:00:00 2001
+From: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>
+Date: Fri, 28 Oct 2011 16:20:24 +0530
+Subject: cpuidle: Remove CPUIDLE_FLAG_IGNORE and dev->prepare()
+
+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>
+(cherry picked from commit b25edc42bfb9602f0503474b2c94701d5536ce60)
+
+Signed-off-by: Simon Horman <horms@verge.net.au>
+---
+ drivers/cpuidle/cpuidle.c | 10 ----------
+ drivers/cpuidle/governors/menu.c | 2 --
+ include/linux/cpuidle.h | 3 ---
+ 3 files changed, 15 deletions(-)
+
+diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
+index c0f1a3a..70350d2 100644
+--- a/drivers/cpuidle/cpuidle.c
++++ b/drivers/cpuidle/cpuidle.c
+@@ -84,16 +84,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()) {
+diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
+index e27a2af..2072aeb 100644
+--- a/drivers/cpuidle/governors/menu.c
++++ b/drivers/cpuidle/governors/menu.c
+@@ -289,8 +289,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)
+diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
+index 8da811b..c6d85cf 100644
+--- a/include/linux/cpuidle.h
++++ b/include/linux/cpuidle.h
+@@ -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);
+--
+1.7.10.1.362.g242cab3
+