linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Rafael Wysocki <rjw@rjwysocki.net>,
	Viresh Kumar <vireshk@kernel.org>, Nishanth Menon <nm@ti.com>,
	Stephen Boyd <sboyd@codeaurora.org>
Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Vincent Guittot <vincent.guittot@linaro.org>,
	jonathanh@nvidia.com, swarren@nvidia.com, treding@nvidia.com,
	Viresh Kumar <viresh.kumar@linaro.org>
Subject: [PATCH] Revert "PM / OPP: Don't assume platform doesn't have regulators"
Date: Wed,  7 Dec 2016 16:01:52 +0530	[thread overview]
Message-ID: <1560e022c1584376cf5a55ed048e0b60485adf2b.1481106666.git.viresh.kumar@linaro.org> (raw)

This reverts commit ef3caabee9691386e6801ea92150e37277db9c7a.

The commit was based on the assumption that a platform with voltages
specified with individual OPPs, would have registered a regulator as
well in order to do full DVFS.

That assumption is broken by the Tegra124 platform.

For Tegra124, the voltage is not scaled via a direct call to the
regulator subsystem because the DFLL directly controls the I2C interface
that controls the voltage. The DFLL essentially figures out the max
frequency for a given voltage. So to run at a particular frequency, the
DFLL continuously adjusts the voltage in a control loop fashion to get
the desired frequency.

Following are the logs from: NVIDIA Tegra124 Jetson TK1

  cpufreq: cpufreq_online: CPU0: Running at unlisted freq: 696000 KHz
  cpu cpu0: dev_pm_opp_set_rate: Regulator not registered with OPP core
  cpufreq: __target_index: Failed to change cpu frequency: -22
  ------------[ cut here ]------------
  kernel BUG at drivers/cpufreq/cpufreq.c:1235!

Fix these by reverting the offending commit.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

---
Rafael, you can simply drop the patch if that is easier for you.
---
 drivers/base/power/opp/core.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/drivers/base/power/opp/core.c b/drivers/base/power/opp/core.c
index 7db672f632d9..6af371a55062 100644
--- a/drivers/base/power/opp/core.c
+++ b/drivers/base/power/opp/core.c
@@ -747,20 +747,7 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
 
 	/* Only frequency scaling */
 	if (!regulators) {
-		unsigned long u_volt = opp->supplies[0].u_volt;
-
 		rcu_read_unlock();
-
-		/*
-		 * DT contained supply ratings? Consider platform failed to set
-		 * regulators.
-		 */
-		if (unlikely(u_volt)) {
-			dev_err(dev, "%s: Regulator not registered with OPP core\n",
-				__func__);
-			return -EINVAL;
-		}
-
 		return _generic_set_opp_clk_only(dev, clk, old_freq, freq);
 	}
 
-- 
2.7.1.410.g6faf27b

             reply	other threads:[~2016-12-07 10:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-07 10:31 Viresh Kumar [this message]
2016-12-07 23:29 ` [PATCH] Revert "PM / OPP: Don't assume platform doesn't have regulators" Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1560e022c1584376cf5a55ed048e0b60485adf2b.1481106666.git.viresh.kumar@linaro.org \
    --to=viresh.kumar@linaro.org \
    --cc=jonathanh@nvidia.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=rjw@rjwysocki.net \
    --cc=sboyd@codeaurora.org \
    --cc=swarren@nvidia.com \
    --cc=treding@nvidia.com \
    --cc=vincent.guittot@linaro.org \
    --cc=vireshk@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).