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 2/3] cpufreq: add support for intermediate (stable) frequencies
Date: Fri, 16 May 2014 12:50:01 -0600 [thread overview]
Message-ID: <53765DD9.6040403@wwwdotorg.org> (raw)
In-Reply-To: <9e1ed1bf8c3610709436fe5ef8df3a63856f8f5c.1400230695.git.viresh.kumar@linaro.org>
On 05/16/2014 03:07 AM, Viresh Kumar wrote:
> Douglas Anderson, recently pointed out an interesting problem due to which
> udelay() was expiring earlier than it should.
>
> While transitioning between frequencies few platforms may temporarily switch to
> a stable frequency, waiting for the main PLL to stabilize.
>
> For example: When we transition between very low frequencies on exynos, like
> between 200MHz and 300MHz, we may temporarily switch to a PLL running at 800MHz.
> No CPUFREQ notification is sent for that. That means there's a period of time
> when we're running at 800MHz but loops_per_jiffy is calibrated at between 200MHz
> and 300MHz. And so udelay behaves badly.
>
> To get this fixed in a generic way, lets introduce another set of callbacks
> get_intermediate() and target_intermediate(), only for drivers with
> target_index() and CPUFREQ_ASYNC_NOTIFICATION unset.
>
> get_intermediate should return a stable intermediate frequency platform wants to
> switch to, and target_intermediate() should set CPU to to that frequency, before
> jumping to the frequency corresponding to 'index'. Core will take care of
> sending notifications and driver doesn't have to handle them in
> target_intermediate() or target_index().
>
> NOTE: Once set to intermediate frequency, driver isn't expected to fail for the
> following ->target_index() call, if it fails core will issue a WARN().
> diff --git a/Documentation/cpu-freq/cpu-drivers.txt b/Documentation/cpu-freq/cpu-drivers.txt
> +cpufreq_driver.get_intermediate
> +and target_intermediate Uset to switch to stable frequency while
> + changing CPU frequency.
s/Uset/Used.
> diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
> @@ -226,6 +226,21 @@ struct cpufreq_driver {
> + unsigned int (*get_intermediate)(struct cpufreq_policy *policy,
> + unsigned int index);
Should get_intermediate be passed a struct cpufreq_freqs freqs rather
than just the target index? That way, if the intermediate frequency
varies depending on old/new frequencies, then the driver won't have to
go look up the current frequency in order to implement that logic.
next prev parent reply other threads:[~2014-05-16 18:50 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 [this message]
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
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=53765DD9.6040403@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox