* [PATCH V2 0/2] cpufreq: cpufreq-dt: Improvements for set_target()
@ 2014-10-17 22:09 Stefan Wahren
2014-10-17 22:09 ` [PATCH V2 1/2] cpufreq: cpufreq-dt: Improve debug about matching OPP Stefan Wahren
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Stefan Wahren @ 2014-10-17 22:09 UTC (permalink / raw)
To: rjw, viresh.kumar; +Cc: linux-pm
This patch series contains 2 improvements for set_target().
changes in V2:
- rebase because of name change cpufreq-cpu0 to cpufreq-dt
Stefan Wahren (2):
cpufreq: cpufreq-dt: Improve debug about matching OPP
cpufreq: cpufreq-dt: Handle regulator_get_voltage() failure
drivers/cpufreq/cpufreq-dt.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH V2 1/2] cpufreq: cpufreq-dt: Improve debug about matching OPP
2014-10-17 22:09 [PATCH V2 0/2] cpufreq: cpufreq-dt: Improvements for set_target() Stefan Wahren
@ 2014-10-17 22:09 ` Stefan Wahren
2014-10-17 22:09 ` [PATCH V2 2/2] cpufreq: cpufreq-dt: Handle regulator_get_voltage() failure Stefan Wahren
2014-10-20 4:43 ` [PATCH V2 0/2] cpufreq: cpufreq-dt: Improvements for set_target() Viresh Kumar
2 siblings, 0 replies; 7+ messages in thread
From: Stefan Wahren @ 2014-10-17 22:09 UTC (permalink / raw)
To: rjw, viresh.kumar; +Cc: linux-pm
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-dt.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
index 6bbb8b9..959d40d 100644
--- a/drivers/cpufreq/cpufreq-dt.c
+++ b/drivers/cpufreq/cpufreq-dt.c
@@ -57,6 +57,8 @@ static int 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 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);
}
dev_dbg(cpu_dev, "%u MHz, %ld mV --> %u MHz, %ld mV\n",
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH V2 2/2] cpufreq: cpufreq-dt: Handle regulator_get_voltage() failure
2014-10-17 22:09 [PATCH V2 0/2] cpufreq: cpufreq-dt: Improvements for set_target() Stefan Wahren
2014-10-17 22:09 ` [PATCH V2 1/2] cpufreq: cpufreq-dt: Improve debug about matching OPP Stefan Wahren
@ 2014-10-17 22:09 ` Stefan Wahren
2014-10-20 4:43 ` [PATCH V2 0/2] cpufreq: cpufreq-dt: Improvements for set_target() Viresh Kumar
2 siblings, 0 replies; 7+ messages in thread
From: Stefan Wahren @ 2014-10-17 22:09 UTC (permalink / raw)
To: rjw, viresh.kumar; +Cc: linux-pm
In error cases regulator_get_voltage() returns a negative value.
So take care of it.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
drivers/cpufreq/cpufreq-dt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
index 959d40d..cabaf8c 100644
--- a/drivers/cpufreq/cpufreq-dt.c
+++ b/drivers/cpufreq/cpufreq-dt.c
@@ -77,7 +77,7 @@ static int set_target(struct cpufreq_policy *policy, unsigned int index)
}
dev_dbg(cpu_dev, "%u MHz, %ld mV --> %u MHz, %ld mV\n",
- old_freq / 1000, volt_old ? volt_old / 1000 : -1,
+ old_freq / 1000, (volt_old > 0) ? volt_old / 1000 : -1,
new_freq / 1000, volt ? volt / 1000 : -1);
/* scaling up? scale voltage before frequency */
@@ -93,7 +93,7 @@ static int set_target(struct cpufreq_policy *policy, unsigned int index)
ret = clk_set_rate(cpu_clk, freq_exact);
if (ret) {
dev_err(cpu_dev, "failed to set clock rate: %d\n", ret);
- if (!IS_ERR(cpu_reg))
+ if (!IS_ERR(cpu_reg) && volt_old > 0)
regulator_set_voltage_tol(cpu_reg, volt_old, tol);
return ret;
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH V2 0/2] cpufreq: cpufreq-dt: Improvements for set_target()
2014-10-17 22:09 [PATCH V2 0/2] cpufreq: cpufreq-dt: Improvements for set_target() Stefan Wahren
2014-10-17 22:09 ` [PATCH V2 1/2] cpufreq: cpufreq-dt: Improve debug about matching OPP Stefan Wahren
2014-10-17 22:09 ` [PATCH V2 2/2] cpufreq: cpufreq-dt: Handle regulator_get_voltage() failure Stefan Wahren
@ 2014-10-20 4:43 ` Viresh Kumar
2014-10-24 7:21 ` Stefan Wahren
2 siblings, 1 reply; 7+ messages in thread
From: Viresh Kumar @ 2014-10-20 4:43 UTC (permalink / raw)
To: Stefan Wahren; +Cc: Rafael J. Wysocki, linux-pm@vger.kernel.org
On 18 October 2014 03:39, Stefan Wahren <stefan.wahren@i2se.com> wrote:
> This patch series contains 2 improvements for set_target().
>
> changes in V2:
> - rebase because of name change cpufreq-cpu0 to cpufreq-dt
>
> Stefan Wahren (2):
> cpufreq: cpufreq-dt: Improve debug about matching OPP
> cpufreq: cpufreq-dt: Handle regulator_get_voltage() failure
>
> drivers/cpufreq/cpufreq-dt.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH V2 0/2] cpufreq: cpufreq-dt: Improvements for set_target()
2014-10-20 4:43 ` [PATCH V2 0/2] cpufreq: cpufreq-dt: Improvements for set_target() Viresh Kumar
@ 2014-10-24 7:21 ` Stefan Wahren
2014-11-08 1:40 ` Rafael J. Wysocki
0 siblings, 1 reply; 7+ messages in thread
From: Stefan Wahren @ 2014-10-24 7:21 UTC (permalink / raw)
To: Viresh Kumar, Rafael J. Wysocki; +Cc: linux-pm@vger.kernel.org
Am 20.10.2014 um 06:43 schrieb Viresh Kumar:
> On 18 October 2014 03:39, Stefan Wahren <stefan.wahren@i2se.com> wrote:
>> This patch series contains 2 improvements for set_target().
>>
>> changes in V2:
>> - rebase because of name change cpufreq-cpu0 to cpufreq-dt
>>
>> Stefan Wahren (2):
>> cpufreq: cpufreq-dt: Improve debug about matching OPP
>> cpufreq: cpufreq-dt: Handle regulator_get_voltage() failure
>>
>> drivers/cpufreq/cpufreq-dt.c | 9 +++++++--
>> 1 file changed, 7 insertions(+), 2 deletions(-)
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Thanks. But maybe the patch series won't apply anymore.
Should i rebase again?
Stefan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH V2 0/2] cpufreq: cpufreq-dt: Improvements for set_target()
2014-10-24 7:21 ` Stefan Wahren
@ 2014-11-08 1:40 ` Rafael J. Wysocki
2014-11-08 8:01 ` Stefan Wahren
0 siblings, 1 reply; 7+ messages in thread
From: Rafael J. Wysocki @ 2014-11-08 1:40 UTC (permalink / raw)
To: Stefan Wahren; +Cc: Viresh Kumar, linux-pm@vger.kernel.org
On Friday, October 24, 2014 09:21:04 AM Stefan Wahren wrote:
> Am 20.10.2014 um 06:43 schrieb Viresh Kumar:
> > On 18 October 2014 03:39, Stefan Wahren <stefan.wahren@i2se.com> wrote:
> >> This patch series contains 2 improvements for set_target().
> >>
> >> changes in V2:
> >> - rebase because of name change cpufreq-cpu0 to cpufreq-dt
> >>
> >> Stefan Wahren (2):
> >> cpufreq: cpufreq-dt: Improve debug about matching OPP
> >> cpufreq: cpufreq-dt: Handle regulator_get_voltage() failure
> >>
> >> drivers/cpufreq/cpufreq-dt.c | 9 +++++++--
> >> 1 file changed, 7 insertions(+), 2 deletions(-)
> > Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
>
> Thanks. But maybe the patch series won't apply anymore.
>
> Should i rebase again?
No need, it still applies. :-)
Queued up for 3.19-rc1, thanks!
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH V2 0/2] cpufreq: cpufreq-dt: Improvements for set_target()
2014-11-08 1:40 ` Rafael J. Wysocki
@ 2014-11-08 8:01 ` Stefan Wahren
0 siblings, 0 replies; 7+ messages in thread
From: Stefan Wahren @ 2014-11-08 8:01 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: Viresh Kumar, linux-pm@vger.kernel.org
> "Rafael J. Wysocki" <rjw@rjwysocki.net> hat am 8. November 2014 um 02:40
> geschrieben:
>
> >
> > Thanks. But maybe the patch series won't apply anymore.
> >
> > Should i rebase again?
>
> No need, it still applies. :-)
Thanks
>
> Queued up for 3.19-rc1, thanks!
>
>
> --
> I speak only for myself.
> Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-11-08 8:01 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-17 22:09 [PATCH V2 0/2] cpufreq: cpufreq-dt: Improvements for set_target() Stefan Wahren
2014-10-17 22:09 ` [PATCH V2 1/2] cpufreq: cpufreq-dt: Improve debug about matching OPP Stefan Wahren
2014-10-17 22:09 ` [PATCH V2 2/2] cpufreq: cpufreq-dt: Handle regulator_get_voltage() failure Stefan Wahren
2014-10-20 4:43 ` [PATCH V2 0/2] cpufreq: cpufreq-dt: Improvements for set_target() Viresh Kumar
2014-10-24 7:21 ` Stefan Wahren
2014-11-08 1:40 ` Rafael J. Wysocki
2014-11-08 8:01 ` Stefan Wahren
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).