From: Stephen Boyd <sboyd@codeaurora.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Michael Turquette <mturquette@baylibre.com>,
linux-clk@vger.kernel.org, Opera <montvid@gmail.com>,
John Stultz <john.stultz@linaro.org>
Subject: Re: [PATCH] RESEND: clk: Avoid sending high rates to downstream clocks during set_rate
Date: Thu, 2 Nov 2017 00:00:03 -0700 [thread overview]
Message-ID: <20171102070003.GI30645@codeaurora.org> (raw)
In-Reply-To: <20171004023006.31763-1-linus.walleij@linaro.org>
On 10/04, Linus Walleij wrote:
> From: Stephen Boyd <sboyd@codeaurora.org>
>
> If a clock is on and we call clk_set_rate() on it we may get into
> a situation where the clock temporarily increases in rate
> dramatically while we walk the tree and call .set_rate() ops. For
> example, consider a case where a PLL feeds into a divider.
> Initially the divider is set to divide by 1 and the PLL is
> running fairly slow (100MHz). The downstream consumer of the
> divider output can only handle rates =< 400 MHz, but the divider
> can only choose between divisors of 1 and 4.
>
> +-----+ +----------------+
> | PLL |-->| div 1 or div 4 |---> consumer device
> +-----+ +----------------+
>
> To achieve a rate of 400MHz on the output of the divider, we
> would have to set the rate of the PLL to 1.6 GHz and then divide
> it by 4. The current code would set the PLL to 1.6GHz first while
> the divider is still set to 1, thus causing the downstream
> consumer of the clock to receive a few clock cycles of 1.6GHz
> clock (far beyond it's maximum acceptable rate). We should be
> changing the divider first before increasing the PLL rate to
> avoid this problem.
>
> Therefore, set the rate of any child clocks that are increasing
> in rate from their current rate so that they can increase their
> dividers if necessary. We assume that there isn't such a thing as
> minimum rate requirements.
>
> Cc: Opera <montvid@gmail.com>
> Cc: John Stultz <john.stultz@linaro.org>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> ---
> Stephen: just wanted to check what's up with this patch.
> When I apply it on my kernel I get graphics on the Nexus7,
> when I don't, I don't.
>
> OpenWRT has started to carry the patch in their tree I noticed.
> I found it in John Stultz patch stack.
>
> Is there some similar patch floating in some other series, is
> it fundamentally wrong or something else?
>
> Just wanted to reboot the discussion so we know where this is
> standing.
This patch wants to go away and be replaced with coordinated clk
rates code. So far, nothing has appeared for that though, so this
problem is stuck in limbo, blocking Krait CPUfreq.
I have no idea why it matters for your Nexus7 graphics stuff. As
far as I know the GPU clk on Nexus7 is a plain old dynamic rcg
that can switch rates glitch free and we don't do anything odd
like reprogramming the parent PLL of the rcg to use faster rates,
which is mostly what this patch is for.
I wrote this patch for Krait CPUfreq originally. In that case we
reprogram PLLs higher up in tree and then have to adjust dividers
below that and doing that in the wrong order causes high
frequencies to come down the tree into the CPU that we can't turn
off.
I suspect OpenWRT has pulled in the patch for Krait CPUfreq. It
could be that you also need it for that. Or it could be that odd
line where we don't look at the result of clk_recalc, and just
blast in the calculated new rate into core->rate somehow fixes
something.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2017-11-02 7:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-04 2:30 [PATCH] RESEND: clk: Avoid sending high rates to downstream clocks during set_rate Linus Walleij
2017-10-30 14:23 ` Linus Walleij
2017-11-02 7:00 ` Stephen Boyd [this message]
[not found] <24C08A61-4CBD-4890-8C7A-DEC665A04E9A@gmail.com>
2017-11-02 7:19 ` Modestas
2017-11-02 7:22 ` Modestas
-- strict thread matches above, loose matches on Subject: below --
2017-11-02 7:38 Modestas
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=20171102070003.GI30645@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=john.stultz@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-clk@vger.kernel.org \
--cc=montvid@gmail.com \
--cc=mturquette@baylibre.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).