From: Stephen Warren <swarren@wwwdotorg.org>
To: Viresh Kumar <viresh.kumar@linaro.org>, rjw@rjwysocki.net
Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org, arvind.chauhan@arm.com,
swarren@nvidia.com, nicolas.pitre@linaro.org,
dianders@chromium.org, linux@arm.linux.org.uk,
thomas.abraham@linaro.org, pdeschrijver@nvidia.com
Subject: Re: [PATCH V2 3/3] cpufreq: Tegra: implement intermediate frequency callbacks
Date: Fri, 16 May 2014 13:39:27 -0600 [thread overview]
Message-ID: <5376696F.9090006@wwwdotorg.org> (raw)
In-Reply-To: <b3e68b08ca8175fde81ef1a85db1fde506f835b9.1400230695.git.viresh.kumar@linaro.org>
On 05/16/2014 03:07 AM, Viresh Kumar wrote:
> Tegra had always been switching to intermediate frequency (pll_p_clk) since
> ever. CPUFreq core has better support for handling notifications for these
> frequencies and so we can adapt Tegra's driver to it.
You need to squash in the patch below in order for this series to work.
Once that's done,
Tested-by: Stephen Warren <swarren@nvidia.com>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
>
> diff --git a/drivers/cpufreq/tegra-cpufreq.c b/drivers/cpufreq/tegra-cpufreq.c
> index 10b29ec99bdc..c04fec02ac6a 100644
> --- a/drivers/cpufreq/tegra-cpufreq.c
> +++ b/drivers/cpufreq/tegra-cpufreq.c
> @@ -49,13 +49,22 @@ static struct clk *emc_clk;
> static unsigned int
> tegra_get_intermediate(struct cpufreq_policy *policy, unsigned int index)
> {
> - return clk_get_rate(pll_p_clk);
> + return clk_get_rate(pll_p_clk) / 1000; /* kHz */
> }
>
> static int
> tegra_target_intermediate(struct cpufreq_policy *policy, unsigned int frequency)
> {
> + WARN_ON(frequency != clk_get_rate(pll_p_clk) / 1000);
> +
> + /*
> + * Take an extra reference to the main pll so it doesn't turn
> + * off when we move the cpu off of it
> + */
> + clk_prepare_enable(pll_x_clk);
> +
> return clk_set_parent(cpu_clk, pll_p_clk);
> + /* FIXME: if error, remove pll_x reference */
> }
>
> static int tegra_target(struct cpufreq_policy *policy, unsigned int index)
> @@ -74,16 +83,10 @@ static int tegra_target(struct cpufreq_policy *policy, unsigned int index)
> else
> clk_set_rate(emc_clk, 100000000); /* emc 50Mhz */
>
> - /*
> - * Take an extra reference to the main pll so it doesn't turn
> - * off when we move the cpu off of it
> - */
> - clk_prepare_enable(pll_x_clk);
> -
> if (rate == clk_get_rate(pll_p_clk))
> goto out;
>
> - ret = clk_set_rate(pll_x_clk, rate);
> + ret = clk_set_rate(pll_x_clk, rate * 1000);
> if (ret) {
> pr_err("Failed to change pll_x to %lu\n", rate);
> goto out;
next prev parent reply other threads:[~2014-05-16 19:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-16 9:03 [PATCH V2 0/3] cpufreq: add support for intermediate (stable) Viresh Kumar
2014-05-16 9:03 ` [PATCH V2 1/3] cpufreq: handle calls to ->target_index() in separate routine Viresh Kumar
2014-05-16 9:07 ` [PATCH V2 2/3] cpufreq: add support for intermediate (stable) frequencies Viresh Kumar
2014-05-16 18:50 ` Stephen Warren
2014-05-17 4:06 ` Viresh Kumar
2014-05-16 9:07 ` [PATCH V2 3/3] cpufreq: Tegra: implement intermediate frequency callbacks Viresh Kumar
2014-05-16 18:52 ` Stephen Warren
2014-05-16 19:39 ` Stephen Warren [this message]
2014-05-17 4:52 ` Viresh Kumar
2014-05-16 10:09 ` [PATCH V2 0/3] cpufreq: add support for intermediate (stable) Thomas Abraham
2014-05-16 10:10 ` Viresh Kumar
2014-05-16 15:20 ` Doug Anderson
2014-05-16 15:26 ` Viresh Kumar
2014-05-16 15:38 ` Doug Anderson
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=5376696F.9090006@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=arvind.chauhan@arm.com \
--cc=dianders@chromium.org \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=nicolas.pitre@linaro.org \
--cc=pdeschrijver@nvidia.com \
--cc=rjw@rjwysocki.net \
--cc=swarren@nvidia.com \
--cc=thomas.abraham@linaro.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.