mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jon Hunter <jonathanh@nvidia.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Rafael J . Wysocki" <rjw@rjwysocki.net>,
	Thierry Reding <thierry.reding@gmail.com>,
	<linux-pm@vger.kernel.org>, <linux-tegra@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V2] cpufreq: tegra186: Fix initial frequency
Date: Mon, 26 Oct 2020 12:57:07 +0000	[thread overview]
Message-ID: <c6ab92fe-e5ea-4568-6457-7a28c8496114@nvidia.com> (raw)
In-Reply-To: <9c37db70-9406-8005-3478-dc4a5e94c566@nvidia.com>


On 19/10/2020 10:33, Jon Hunter wrote:
> 
> On 16/10/2020 05:07, Viresh Kumar wrote:
>> On 15-10-20, 15:03, Jon Hunter wrote:
>>> If not too late, would you mind dropping this patch for v5.10?
>>
>> It is already part of Linus's master now.
> 
> OK, thanks. I will send a revert for this once rc1 is out.


Thinking about this some more, what are your thoughts on making the
following change? 

Basically, if the driver sets the CPUFREQ_NEED_INITIAL_FREQ_CHECK,
then I wonder if we should not fail if the frequency return by
>get() is not known. This would fix the problem I see on Tegra186
where the initial boot frequency may not be in the frequency table.

Cheers
Jon

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index f4b60663efe6..b7d3b61577b0 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1426,13 +1426,8 @@ static int cpufreq_online(unsigned int cpu)
                                CPUFREQ_CREATE_POLICY, policy);
        }
 
-       if (cpufreq_driver->get && has_target()) {
+       if (cpufreq_driver->get && has_target())
                policy->cur = cpufreq_driver->get(policy->cpu);
-               if (!policy->cur) {
-                       pr_err("%s: ->get() failed\n", __func__);
-                       goto out_destroy_policy;
-               }
-       }
 
        /*
         * Sometimes boot loaders set CPU frequency to a value outside of
@@ -1471,6 +1466,11 @@ static int cpufreq_online(unsigned int cpu)
                        pr_info("%s: CPU%d: Running at unlisted initial frequency: %u KHz, changing to: %u KHz\n",
                                __func__, policy->cpu, old_freq, policy->cur);
                }
+       } else {
+               if (!policy->cur) {
+                       pr_err("%s: ->get() failed\n", __func__);
+                       goto out_destroy_policy;
+               }
        }
 
        if (new_policy) {

-- 
nvpublic

  reply	other threads:[~2020-10-26 12:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-24 14:59 Jon Hunter
2020-08-25  5:50 ` Viresh Kumar
2020-08-25  8:22   ` Jon Hunter
2020-10-15 14:03   ` Jon Hunter
2020-10-16  4:07     ` Viresh Kumar
2020-10-19  9:33       ` Jon Hunter
2020-10-26 12:57         ` Jon Hunter [this message]
2020-10-28  4:11           ` Viresh Kumar
2020-10-28 12:31             ` Jon Hunter
2020-10-28 14:52               ` Viresh Kumar

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=c6ab92fe-e5ea-4568-6457-7a28c8496114@nvidia.com \
    --to=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=thierry.reding@gmail.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

Powered by JetHome