linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Jon Hunter <jonathanh@nvidia.com>
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: Wed, 28 Oct 2020 20:22:26 +0530	[thread overview]
Message-ID: <20201028145226.5fzl6ryxbkwyxdmz@vireshk-i7> (raw)
In-Reply-To: <382ba642-dbea-c36a-0c71-6e91ccb7b775@nvidia.com>

On 28-10-20, 12:31, Jon Hunter wrote:
> On 28/10/2020 04:11, Viresh Kumar wrote:
> > When do we fail if the frequency isn't known ? That's the case where
> > we try to set it to one from the table.
> 
> Currently, if the frequency is not known, we fail right before we do the
> initial frequency check [0].

Right, so the frequency returned there is 0. By unknown I assumed that
you are talking about the case where the frequency isn't found in the
table.

> > But (looking at your change), ->get() can't really return 0. We depend
> > on it to get us the exact frequency the hardware is programmed at
> > instead of reading a cached value in the software.
> 
> Actually it can and it does currently. Note in tegra186_cpufreq_get()
> the variable 'freq' is initialised to 0, and if no match is found, then
> it returns 0. This is what happens currently on some Tegra186 boards.

Then there is a problem with the implementation of this helper in your
case. This shouldn't try to go compare the value read from the
register with the table, rather convert that directly to a meaningful
frequency. Its like reading registers and then doing some computations
with the values read with the parent PLLs frequency. Something like
what you will normally do in the implementation of clk_get_rate().

-- 
viresh

      reply	other threads:[~2020-10-29  2:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-24 14:59 [PATCH V2] cpufreq: tegra186: Fix initial frequency 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
2020-10-28  4:11           ` Viresh Kumar
2020-10-28 12:31             ` Jon Hunter
2020-10-28 14:52               ` Viresh Kumar [this message]

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=20201028145226.5fzl6ryxbkwyxdmz@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=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 \
    /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).