diff mbox

[35/35] cpufreq: tegra: use cpufreq_table_validate_and_show()

Message ID CAKohpo=Gy7D2LYmdFU1p+eL-nMoPE18YXWvE2M8t-fb-a5HBgg@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Viresh Kumar Aug. 9, 2013, 4:04 a.m. UTC
On 8 August 2013 21:37, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> Its useless and the correct routine isn't called at all :) .. I will add that
> additional patch and send it to you and will get this change out of this
> commit.

The two commits look like this now attached too in case you want
to test:

commit 9abdc9127b9f7f1e00c75694d15345843a60ff99
Author: Viresh Kumar <viresh.kumar@linaro.org>
Date:   Thu Aug 8 16:40:32 2013 +0530

    cpufreq: tegra: use cpufreq_table_validate_and_show()

    Lets use cpufreq_table_validate_and_show() instead of calling
    cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

    Cc: Stephen Warren <swarren@nvidia.com>
    Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/tegra-cpufreq.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Stephen Warren Aug. 9, 2013, 4:19 p.m. UTC | #1
On 08/08/2013 10:04 PM, Viresh Kumar wrote:
> On 8 August 2013 21:37, Viresh Kumar <viresh.kumar@linaro.org> wrote:
>> Its useless and the correct routine isn't called at all :) .. I will add that
>> additional patch and send it to you and will get this change out of this
>> commit.
> 
> The two commits look like this now attached too in case you want
> to test:

I'd be happy to test, but those changes cause build failures on top of
next-20130809. Which other patches do I need to apply first?
Viresh Kumar Aug. 9, 2013, 5:09 p.m. UTC | #2
On 9 August 2013 21:49, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 08/08/2013 10:04 PM, Viresh Kumar wrote:
>> On 8 August 2013 21:37, Viresh Kumar <viresh.kumar@linaro.org> wrote:
>>> Its useless and the correct routine isn't called at all :) .. I will add that
>>> additional patch and send it to you and will get this change out of this
>>> commit.
>>
>> The two commits look like this now attached too in case you want
>> to test:
>
> I'd be happy to test, but those changes cause build failures on top of
> next-20130809. Which other patches do I need to apply first?

None.. You applied all three attached patches? I have given it a try
on my side now and it worked without any issues..

Just pushed out a branch for you as well:

https://git.linaro.org/gitweb?p=people/vireshk/linux.git;a=shortlog;h=refs/heads/tegra-test
Stephen Warren Aug. 9, 2013, 10:08 p.m. UTC | #3
On 08/09/2013 11:09 AM, Viresh Kumar wrote:
> On 9 August 2013 21:49, Stephen Warren <swarren@wwwdotorg.org> wrote:
>> On 08/08/2013 10:04 PM, Viresh Kumar wrote:
>>> On 8 August 2013 21:37, Viresh Kumar <viresh.kumar@linaro.org> wrote:
>>>> Its useless and the correct routine isn't called at all :) .. I will add that
>>>> additional patch and send it to you and will get this change out of this
>>>> commit.
>>>
>>> The two commits look like this now attached too in case you want
>>> to test:
>>
>> I'd be happy to test, but those changes cause build failures on top of
>> next-20130809. Which other patches do I need to apply first?
> 
> None.. You applied all three attached patches? I have given it a try
> on my side now and it worked without any issues..
> 
> Just pushed out a branch for you as well:
> 
> https://git.linaro.org/gitweb?p=people/vireshk/linux.git;a=shortlog;h=refs/heads/tegra-test

Well, I don't see any issues running this, although the cpufreq sysfs
files seem to have disappeared on Tegra, even without your changes, so
I'm not sure how to really verify cpufreq.

Did the sysfs files go away, or do I need to investigate why/when the
disappeared?
Viresh Kumar Aug. 10, 2013, 2:53 a.m. UTC | #4
On 10 August 2013 03:38, Stephen Warren <swarren@wwwdotorg.org> wrote:
> Well, I don't see any issues running this, although the cpufreq sysfs
> files seem to have disappeared on Tegra, even without your changes, so
> I'm not sure how to really verify cpufreq.
>
> Did the sysfs files go away, or do I need to investigate why/when the
> disappeared?

It wasn't enabled by default in your defconfig... So enable it first with
your menuconfig.
Stephen Warren Aug. 12, 2013, 4:33 p.m. UTC | #5
On 08/09/2013 08:53 PM, Viresh Kumar wrote:
> On 10 August 2013 03:38, Stephen Warren <swarren@wwwdotorg.org> wrote:
>> Well, I don't see any issues running this, although the cpufreq sysfs
>> files seem to have disappeared on Tegra, even without your changes, so
>> I'm not sure how to really verify cpufreq.
>>
>> Did the sysfs files go away, or do I need to investigate why/when the
>> disappeared?
> 
> It wasn't enabled by default in your defconfig... So enable it first with
> your menuconfig.

It's in defconfig OK; I think the driver simply isn't initializing since
some of the clocks it requests don't exist. I'll have our clock driver
author look into it. In the meantime, I assume that your change is
likely fine.
Viresh Kumar Aug. 12, 2013, 5:01 p.m. UTC | #6
On 12 August 2013 22:03, Stephen Warren <swarren@wwwdotorg.org> wrote:
> It's in defconfig OK; I think the driver simply isn't initializing since
> some of the clocks it requests don't exist. I'll have our clock driver
> author look into it. In the meantime, I assume that your change is
> likely fine.

I wasn't' talking about your driver but cpufreq_stats.. That is disabled
by default with your defconfig.
diff mbox

Patch

diff --git a/drivers/cpufreq/tegra-cpufreq.c b/drivers/cpufreq/tegra-cpufreq.c
index cd66b85..51752b3 100644
--- a/drivers/cpufreq/tegra-cpufreq.c
+++ b/drivers/cpufreq/tegra-cpufreq.c
@@ -215,8 +215,7 @@  static int tegra_cpu_init(struct cpufreq_policy *policy)
        clk_prepare_enable(emc_clk);
        clk_prepare_enable(cpu_clk);

-       cpufreq_frequency_table_cpuinfo(policy, freq_table);
-       cpufreq_frequency_table_get_attr(freq_table, policy->cpu);
+       cpufreq_table_validate_and_show(policy, freq_table);
        policy->cur = tegra_getspeed(policy->cpu);
        target_cpu_speed[policy->cpu] = policy->cur;


commit f1bb1cab6130501251eee616280b88c0b49d96d7
Author: Viresh Kumar <viresh.kumar@linaro.org>
Date:   Fri Aug 9 09:29:19 2013 +0530

    cpufreq: tegra: fix implementation of ->exit()

    ->exit() of drivers should call cpufreq_frequency_table_put_attr()
if they have
    called cpufreq_frequency_table_get_attr() earlier in init() and they aren't
    required to validate their cpufreq table in exit by calling
    cpufreq_frequency_table_cpuinfo(). Tegra's driver wasn't calling
    cpufreq_frequency_table_put_attr() and was calling
    cpufreq_frequency_table_cpuinfo() in exit.

    Fix both these issues in it.

    Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/tegra-cpufreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpufreq/tegra-cpufreq.c b/drivers/cpufreq/tegra-cpufreq.c
index 51752b3..faf1ce5 100644
--- a/drivers/cpufreq/tegra-cpufreq.c
+++ b/drivers/cpufreq/tegra-cpufreq.c
@@ -232,7 +232,7 @@  static int tegra_cpu_init(struct cpufreq_policy *policy)

 static int tegra_cpu_exit(struct cpufreq_policy *policy)
 {
-       cpufreq_frequency_table_cpuinfo(policy, freq_table);
+       cpufreq_frequency_table_put_attr(policy->cpu);
        clk_disable_unprepare(emc_clk);
        return 0;
 }