aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2016-08-16 12:07:31 +0800
committerAlex Shi <alex.shi@linaro.org>2016-08-17 16:31:21 +0800
commit2b8870cc6da843b3e72d7de698e6299a5bf30b8e (patch)
treedf2d6e6ad2abae17b13244a742c4275ad079c7d6
parent35d3f6053b6681de3514d4c8b1af8b1f4a562f10 (diff)
downloadlinux-linaro-stable-for-test.tar.gz
cpuidle/ladder: add per cpu pm_qos_resume_latency considerationfor-test
Kernel or user may have special requirement on cpu response time, like if a interrupt is pinned to a cpu, we don't want the cpu goes to deep sleep. This patch can prevent this thing happen by consider per cpu resume_latency setting in cpu sleep state selection in laddr governor. Signed-off-by: Alex Shi <alex.shi@linaro.org>
-rw-r--r--drivers/cpuidle/governors/ladder.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/cpuidle/governors/ladder.c b/drivers/cpuidle/governors/ladder.c
index 63bd5a403e22..d85bde88b434 100644
--- a/drivers/cpuidle/governors/ladder.c
+++ b/drivers/cpuidle/governors/ladder.c
@@ -18,6 +18,7 @@
#include <linux/module.h>
#include <linux/jiffies.h>
#include <linux/tick.h>
+#include <linux/cpu.h>
#include <asm/io.h>
#include <asm/uaccess.h>
@@ -69,8 +70,14 @@ static int ladder_select_state(struct cpuidle_driver *drv,
{
struct ladder_device *ldev = this_cpu_ptr(&ladder_devices);
struct ladder_device_state *last_state;
+ struct device *device = get_cpu_device(dev->cpu);
int last_residency, last_idx = ldev->last_state_idx;
int latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY);
+ int resume_latency = dev_pm_qos_read_value(device);
+
+ /* resume_latency is 0 means no restriction */
+ if (resume_latency && resume_latency < latency_req)
+ latency_req = resume_latency;
/* Special case when user has set very strict latency requirement */
if (unlikely(latency_req == 0)) {