From: Stefan Wahren <stefan.wahren@i2se.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
Shawn Guo <shawn.guo@freescale.com>
Subject: Re: [PATCH 1/2] cpufreq: cpu0: Improve debug about matching OPP
Date: Mon, 06 Oct 2014 08:50:06 +0200 [thread overview]
Message-ID: <54323B9E.2020407@i2se.com> (raw)
In-Reply-To: <CAKohpokKZ9bc_=CSsy8W000egE1hM60pH1pn2Uxcdxv3oYS1EQ@mail.gmail.com>
Am 06.10.2014 um 07:13 schrieb Viresh Kumar:
> On 5 October 2014 01:56, Stefan Wahren <stefan.wahren@i2se.com> wrote:
>> During test of new DT OPPs it's very helpful to print the matching
>> OPP in case of frequency change. So it will be easier to find frequency
>> rounding issues in the dts file.
>>
>> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
>> ---
>> drivers/cpufreq/cpufreq-cpu0.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c
>> index a5f8c5f..ef3d618 100644
>> --- a/drivers/cpufreq/cpufreq-cpu0.c
>> +++ b/drivers/cpufreq/cpufreq-cpu0.c
>> @@ -57,6 +57,8 @@ static int cpu0_set_target(struct cpufreq_policy *policy, unsigned int index)
>> old_freq = clk_get_rate(cpu_clk) / 1000;
>>
>> if (!IS_ERR(cpu_reg)) {
>> + unsigned long opp_freq;
>> +
>> rcu_read_lock();
>> opp = dev_pm_opp_find_freq_ceil(cpu_dev, &freq_Hz);
>> if (IS_ERR(opp)) {
>> @@ -66,9 +68,12 @@ static int cpu0_set_target(struct cpufreq_policy *policy, unsigned int index)
>> return PTR_ERR(opp);
>> }
>> volt = dev_pm_opp_get_voltage(opp);
>> + opp_freq = dev_pm_opp_get_freq(opp);
>> rcu_read_unlock();
>> tol = volt * priv->voltage_tolerance / 100;
>> volt_old = regulator_get_voltage(cpu_reg);
>> + dev_dbg(cpu_dev, "Found OPP: %ld kHz, %ld uV\n",
>> + opp_freq / 1000, volt);
> What about using dev_pm_opp_get_freq() directly in dev_dbg() instead of
> creating a separate variable?
I wasn't sure because of the read lock and wanted to avoid any delays.
If it's okay i will change it.
>
>> }
>>
>> dev_dbg(cpu_dev, "%u MHz, %ld mV --> %u MHz, %ld mV\n",
>> --
>> 1.7.9.5
>>
next prev parent reply other threads:[~2014-10-06 6:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-04 20:26 [PATCH 0/2] cpufreq: cpu0: Improvements for cpu0_set_target() Stefan Wahren
2014-10-04 20:26 ` [PATCH 1/2] cpufreq: cpu0: Improve debug about matching OPP Stefan Wahren
2014-10-06 5:13 ` Viresh Kumar
2014-10-06 6:50 ` Stefan Wahren [this message]
2014-10-06 8:47 ` Viresh Kumar
2014-10-04 20:26 ` [PATCH 2/2] cpufreq: cpu0: Handle regulator_get_voltage() failure Stefan Wahren
2014-10-06 5:15 ` Viresh Kumar
2014-10-05 21:34 ` [PATCH 0/2] cpufreq: cpu0: Improvements for cpu0_set_target() Rafael J. Wysocki
2014-10-06 6:16 ` Stefan Wahren
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=54323B9E.2020407@i2se.com \
--to=stefan.wahren@i2se.com \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=shawn.guo@freescale.com \
--cc=viresh.kumar@linaro.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).