From 188a54eff59903c770c7f1f9bd4b0787a73b0f0e Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Wed, 31 Oct 2012 01:28:21 +0100 Subject: [PATCH] --- yaml --- r: 336712 b: refs/heads/master c: 7249924e537816368c4a35afd97ab311f75a6368 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/cpufreq/cpufreq.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 956531cab274..8abda13fc876 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5a1c022850ea5d64c2997bf9b89f5ae112d5ee4d +refs/heads/master: 7249924e537816368c4a35afd97ab311f75a6368 diff --git a/trunk/drivers/cpufreq/cpufreq.c b/trunk/drivers/cpufreq/cpufreq.c index 28dc134cec36..2f5ac2dcfda6 100644 --- a/trunk/drivers/cpufreq/cpufreq.c +++ b/trunk/drivers/cpufreq/cpufreq.c @@ -1470,12 +1470,19 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy, unsigned int relation) { int retval = -EINVAL; + unsigned int old_target_freq = target_freq; if (cpufreq_disabled()) return -ENODEV; - pr_debug("target for CPU %u: %u kHz, relation %u\n", policy->cpu, - target_freq, relation); + /* Make sure that target_freq is within supported range */ + if (target_freq > policy->max) + target_freq = policy->max; + if (target_freq < policy->min) + target_freq = policy->min; + + pr_debug("target for CPU %u: %u kHz, relation %u, requested %u kHz\n", + policy->cpu, target_freq, relation, old_target_freq); if (target_freq == policy->cur) return 0;