diff options
author | Alex Frid <afrid@nvidia.com> | 2012-05-14 21:06:11 -0700 |
---|---|---|
committer | Rohan Somvanshi <rsomvanshi@nvidia.com> | 2012-05-17 04:26:40 -0700 |
commit | 30ea6f3571852533737e412b5f7786fdac8b6c9f (patch) | |
tree | 20b77621aa50d2b866a66076e438a610c17bf9e5 /drivers/cpufreq | |
parent | 1ed0961122af7753b557a46ede66e4e78c71138a (diff) |
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 <afrid@nvidia.com>
Reviewed-on: http://git-master/r/102386
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Donghan Ryu <dryu@nvidia.com>
Reviewed-by: Antti Miettinen <amiettinen@nvidia.com>
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
Tested-by: Vikas Ramesh Kedigehalli <vikasr@nvidia.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 7 |
1 files changed, 4 insertions, 3 deletions
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; } |