From: Javi Merino <javi.merino@arm.com>
To: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, cw00.choi@samsung.com,
edubezval@gmail.com, Javi Merino <javi.merino@arm.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>
Subject: [PATCH v6 2/5] PM / OPP: get the voltage for all OPPs
Date: Thu, 10 Sep 2015 18:09:29 +0100 [thread overview]
Message-ID: <1441904972-5809-3-git-send-email-javi.merino@arm.com> (raw)
In-Reply-To: <1441904972-5809-1-git-send-email-javi.merino@arm.com>
The OPP library is now used for power models to calculate the power
that a device would consume at a specific OPP. To do that, we use a
simple power model which takes frequency and voltage as inputs. We get
the voltage and frequency from the OPP library.
The devfreq cooling device for the thermal framework controls
temperature by disabling OPPs. The power model needs to calculate the
power that would be consumed if we reenabled the OPP. Therefore, let
dev_pm_opp_get_voltage() work for disabled OPPs.
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Javi Merino <javi.merino@arm.com>
---
drivers/base/power/opp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
index eb254497a494..c9a0187bba10 100644
--- a/drivers/base/power/opp.c
+++ b/drivers/base/power/opp.c
@@ -217,7 +217,7 @@ static struct device_opp *_find_device_opp(struct device *dev)
}
/**
- * dev_pm_opp_get_voltage() - Gets the voltage corresponding to an available opp
+ * dev_pm_opp_get_voltage() - Gets the voltage corresponding to an opp
* @opp: opp for which voltage has to be returned for
*
* Return: voltage in micro volt corresponding to the opp, else
@@ -239,7 +239,7 @@ unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp)
opp_rcu_lockdep_assert();
tmp_opp = rcu_dereference(opp);
- if (IS_ERR_OR_NULL(tmp_opp) || !tmp_opp->available)
+ if (IS_ERR_OR_NULL(tmp_opp))
pr_err("%s: Invalid parameters\n", __func__);
else
v = tmp_opp->u_volt;
--
1.9.1
next prev parent reply other threads:[~2015-09-10 17:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-10 17:09 [PATCH v6 0/5] Devfreq cooling device Javi Merino
2015-09-10 17:09 ` [PATCH v6 1/5] PM / devfreq: cache the last call to get_dev_status() Javi Merino
2015-09-10 17:09 ` Javi Merino [this message]
2015-09-10 17:09 ` [PATCH v6 3/5] thermal: Add devfreq cooling Javi Merino
2015-09-10 17:09 ` [PATCH v6 4/5] devfreq_cooling: add trace information Javi Merino
2015-09-10 17:19 ` Steven Rostedt
2015-09-18 13:55 ` Javi Merino
2015-09-18 14:04 ` Steven Rostedt
2015-10-14 11:53 ` Javi Merino
2015-10-14 13:22 ` Steven Rostedt
2015-09-10 17:09 ` [PATCH v6 5/5] PM / devfreq: drop comment about thermal setting max_freq Javi Merino
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=1441904972-5809-3-git-send-email-javi.merino@arm.com \
--to=javi.merino@arm.com \
--cc=cw00.choi@samsung.com \
--cc=edubezval@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
/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