From 30ea6f3571852533737e412b5f7786fdac8b6c9f Mon Sep 17 00:00:00 2001 From: Alex Frid Date: Mon, 14 May 2012 21:06:11 -0700 Subject: cpufreq: Don't clip PM QoS requests to old policy limits Clipping PM QoS requests to combined old policy limits that include both PM QoS and user policy requests creates a circular dependency. As a result new PM QoS maximum limit is rejected if it is above previous PM QoS minimum limit even though the new PM QoS minimum limit has been already lowered below new PM QoS maximum limit. Instead clip PM QoS request to the old user policy limits only. Change-Id: Ice0a53a699e0798f07f0e32d6b8a28586fe5db0c Signed-off-by: Alex Frid Reviewed-on: http://git-master/r/102386 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Donghan Ryu Reviewed-by: Antti Miettinen Reviewed-by: Diwakar Tundlam Tested-by: Vikas Ramesh Kedigehalli --- drivers/cpufreq/cpufreq.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers/cpufreq') diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 5bbe8c3d9e96..629806dc5cbf 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1640,9 +1640,9 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data, unsigned int pmax = policy->max; qmin = min((unsigned int)pm_qos_request(PM_QOS_CPU_FREQ_MIN), - data->max); + data->user_policy.max); qmax = max((unsigned int)pm_qos_request(PM_QOS_CPU_FREQ_MAX), - data->min); + data->user_policy.min); pr_debug("setting new policy for CPU %u: %u - %u (%u - %u) kHz\n", policy->cpu, pmin, pmax, qmin, qmax); @@ -1654,7 +1654,8 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data, memcpy(&policy->cpuinfo, &data->cpuinfo, sizeof(struct cpufreq_cpuinfo)); - if (policy->min > data->max || policy->max < data->min) { + if (policy->min > data->user_policy.max || + policy->max < data->user_policy.min) { ret = -EINVAL; goto error_out; } -- cgit v1.2.3