diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2015-09-02 14:36:50 +0530 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-10-27 22:14:09 -0400 |
commit | d3e32326c31c915dc6cd86f015deed2708e5d1bb (patch) | |
tree | 5454dfb6210ade9b443b5c8d82b8c48f0c17a992 | |
parent | b2aac3f62f292863c348c968524a153eac8dbf5b (diff) | |
download | lwn-d3e32326c31c915dc6cd86f015deed2708e5d1bb.tar.gz lwn-d3e32326c31c915dc6cd86f015deed2708e5d1bb.zip |
cpufreq: dt: Tolerance applies on both sides of target voltage
[ Upstream commit a2022001cebd0825b96aa0f3345ea3ad44ae79d4 ]
Tolerance applies on both sides of the target voltage, i.e. both min and
max sides. But while checking if a voltage is supported by the regulator
or not, we haven't taken care of tolerance on the lower side. Fix that.
Cc: Lucas Stach <l.stach@pengutronix.de>
Fixes: 045ee45c4ff2 ("cpufreq: cpufreq-dt: disable unsupported OPPs")
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
-rw-r--r-- | drivers/cpufreq/cpufreq-dt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index f657c571b18e..bdb6951d0978 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -240,7 +240,8 @@ static int cpufreq_init(struct cpufreq_policy *policy) rcu_read_unlock(); tol_uV = opp_uV * priv->voltage_tolerance / 100; - if (regulator_is_supported_voltage(cpu_reg, opp_uV, + if (regulator_is_supported_voltage(cpu_reg, + opp_uV - tol_uV, opp_uV + tol_uV)) { if (opp_uV < min_uV) min_uV = opp_uV; |