Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1217430

[PATCH 3/3] cpufreq: dt: Tolerance applies on both sides of target voltage

From Viresh Kumar <viresh.kumar@linaro.org>
Newsgroups linux.kernel
Subject [PATCH 3/3] cpufreq: dt: Tolerance applies on both sides of target voltage
Date 2015-09-02 11:10 +0200
Message-ID <q4cdj-zo-3@gated-at.bofh.it> (permalink)
References <q4cdj-zo-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 drivers/cpufreq/cpufreq-dt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
index b1131cf89757..3b64c203bf99 100644
--- a/drivers/cpufreq/cpufreq-dt.c
+++ b/drivers/cpufreq/cpufreq-dt.c
@@ -303,7 +303,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;
-- 
2.4.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 3/3] cpufreq: dt: Tolerance applies on both sides of target voltage Viresh Kumar <viresh.kumar@linaro.org> - 2015-09-02 11:10 +0200
  Re: [PATCH 3/3] cpufreq: dt: Tolerance applies on both sides of  target voltage Lucas Stach <l.stach@pengutronix.de> - 2015-09-02 11:40 +0200
    Re: [PATCH 3/3] cpufreq: dt: Tolerance applies on both sides of  target voltage Viresh Kumar <viresh.kumar@linaro.org> - 2015-09-02 11:50 +0200

csiph-web