From: Doug Anderson <dianders@chromium.org>
To: Nicolas Pitre <nicolas.pitre@linaro.org>
Cc: Stephen Warren <swarren@wwwdotorg.org>,
Russell King - ARM Linux <linux@arm.linux.org.uk>,
Viresh Kumar <viresh.kumar@linaro.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Will Deacon <will.deacon@arm.com>,
John Stultz <john.stultz@linaro.org>,
David Riley <davidriley@chromium.org>,
"olof@lixom.net" <olof@lixom.net>,
Sonny Rao <sonnyrao@chromium.org>,
Santosh Shilimkar <santosh.shilimkar@ti.com>,
Shawn Guo <shawn.guo@linaro.org>,
Stephen Boyd <sboyd@codeaurora.org>,
Marc Zyngier <marc.zyngier@arm.com>,
Stephen Warren <swarren@nvidia.com>,
Paul Gortmaker <paul.gortmaker@windriver.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ARM: Don't ever downscale loops_per_jiffy in SMP systems#
Date: Wed, 14 May 2014 14:42:55 -0700 [thread overview]
Message-ID: <CAD=FV=U+Uxd9d726-1mBY=MmL1bKfGQosvLmvttJavf3y4VftQ@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.2.11.1405131922580.980@knanqh.ubzr>
Hi,
On Tue, May 13, 2014 at 4:29 PM, Nicolas Pitre <nicolas.pitre@linaro.org> wrote:
> On Tue, 13 May 2014, Nicolas Pitre wrote:
>
>> On Tue, 13 May 2014, Stephen Warren wrote:
>>
>> > On 05/13/2014 03:50 PM, Doug Anderson wrote:
>> > ...
>> > > ...but then I found the true problem shows up when we transition
>> > > between very low frequencies on exynos, like between 200MHz and
>> > > 300MHz. While transitioning between frequencies the system
>> > > temporarily bumps over to the "switcher" PLL running at 800MHz while
>> > > waiting for the main PLL to stabilize. 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.
>> > >
>> > >
>> > > I'm welcome to any suggestions for how to address this. It sorta
>> > > feels like it would be a common thing to have a temporary PLL during
>> > > the transition, ...
>> >
>> > We definitely do that on Tegra for some cpufreq transitions.
>>
>> Ouch... If this is a common strategy to use a third frequency during a
>> transition phase, especially if that frequency is way off (800MHz vs
>> 200-300MHz) then it is something the cpufreq layer must capture and
>> advertise.
>
> Of course if only the loops_per_jiffy scaling does care about frequency
> changes these days, and if in those cases udelay() can instead be moved
> to a timer source on those hick-up prone platforms, then all this is
> fairly theoretical and may not be worth pursuing.
Yup, I think I'm going to abandon this. If anyone ever runs into this
problem later and can't use a bloody timer, hopefully they'll stumble
on this thread and at least end up with a good starting point.
For the record, the fix I made locally (which actually worked) was:
1. Add a new "temp" field to cpufreq_freqs:
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -133,6 +133,7 @@ struct cpufreq_freqs {
unsigned int cpu; /* cpu nr */
unsigned int old;
unsigned int new;
+ unsigned int temp;
u8 flags; /* flags of cpufreq_driver, see below. */
};
...depending on whether all users of this structure zero-initialize it
(I didn't check) you might also need to add a flag to say whether the
temp field is actually valid.
2. Set the "temp" to the switching PLL frequency in the cpufreq driver.
3. Change the ARM cpufreq_callback() to take the temp freq into account:
+ if (val == CPUFREQ_PRECHANGE) {
+ old_freq = freq->old;
+ new_freq = max(freq->new, freq->temp);
+ } else if (val == CPUFREQ_POSTCHANGE) {
+ old_freq = max(freq->old, freq->temp);
+ new_freq = freq->new;
+ }
...then use old_freq and new_freq in the place of freq->old and freq->new
-Doug
next prev parent reply other threads:[~2014-05-14 21:42 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-07 23:23 [PATCH] ARM: Don't ever downscale loops_per_jiffy in SMP systems Doug Anderson
2014-05-08 10:41 ` Viresh Kumar
2014-05-08 15:25 ` Doug Anderson
2014-05-08 16:04 ` Nicolas Pitre
2014-05-08 16:41 ` Doug Anderson
2014-05-08 17:43 ` Nicolas Pitre
2014-05-08 18:06 ` Doug Anderson
2014-05-08 19:59 ` Nicolas Pitre
2014-05-08 20:55 ` Russell King - ARM Linux
2014-05-09 0:02 ` Doug Anderson
2014-05-09 0:23 ` Russell King - ARM Linux
2014-05-09 4:41 ` Doug Anderson
2014-05-08 19:22 ` Russell King - ARM Linux
2014-05-08 20:12 ` Nicolas Pitre
2014-05-08 20:39 ` John Stultz
2014-05-08 20:52 ` Russell King - ARM Linux
2014-05-09 1:37 ` Nicolas Pitre
2014-05-09 4:43 ` Doug Anderson
2014-05-09 9:18 ` [PATCH] ARM: Don't ever downscale loops_per_jiffy in SMP systems# Russell King - ARM Linux
2014-05-09 18:00 ` Nicolas Pitre
2014-05-09 18:22 ` Russell King - ARM Linux
2014-05-09 21:05 ` Nicolas Pitre
2014-05-12 23:51 ` Doug Anderson
2014-05-13 21:50 ` Doug Anderson
2014-05-13 22:15 ` Stephen Warren
2014-05-13 23:15 ` Nicolas Pitre
2014-05-13 23:29 ` Nicolas Pitre
2014-05-13 23:36 ` Russell King - ARM Linux
2014-05-14 21:42 ` Doug Anderson [this message]
2014-05-15 6:12 ` Viresh Kumar
2014-05-09 9:25 ` [PATCH] ARM: Don't ever downscale loops_per_jiffy in SMP systems 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='CAD=FV=U+Uxd9d726-1mBY=MmL1bKfGQosvLmvttJavf3y4VftQ@mail.gmail.com' \
--to=dianders@chromium.org \
--cc=davidriley@chromium.org \
--cc=john.stultz@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=marc.zyngier@arm.com \
--cc=nicolas.pitre@linaro.org \
--cc=olof@lixom.net \
--cc=paul.gortmaker@windriver.com \
--cc=rjw@rjwysocki.net \
--cc=santosh.shilimkar@ti.com \
--cc=sboyd@codeaurora.org \
--cc=shawn.guo@linaro.org \
--cc=sonnyrao@chromium.org \
--cc=swarren@nvidia.com \
--cc=swarren@wwwdotorg.org \
--cc=viresh.kumar@linaro.org \
--cc=will.deacon@arm.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).