From: James Liao <jamesjj.liao@mediatek.com>
To: Stephen Boyd <sboyd@codeaurora.org>,
Michael Turquette <mturquette@baylibre.com>
Cc: Rob Herring <robh@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Arnd Bergmann <arnd@arndb.de>, <devicetree@vger.kernel.org>,
Erin Lo <erin.lo@mediatek.com>, <linux-kernel@vger.kernel.org>,
<srv_heupstream@mediatek.com>,
<linux-mediatek@lists.infradead.org>,
"Sascha Hauer" <kernel@pengutronix.de>,
Matthias Brugger <matthias.bgg@gmail.com>,
<linux-clk@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v9 01/10] clk: fix initial state of critical clock's parents
Date: Fri, 12 Aug 2016 16:17:53 +0800 [thread overview]
Message-ID: <1470989873.8551.10.camel@mtksdaap41> (raw)
In-Reply-To: <20160810210922.GD2996@codeaurora.org>
On Wed, 2016-08-10 at 14:09 -0700, Stephen Boyd wrote:
> (Including lists)
>
> On 08/09, James Liao wrote:
> > On Wed, 2016-08-03 at 13:46 +0800, James Liao wrote:
> >>
> >> Hi Mike,
> >>
> >> Do you have new patches to fix new clock parents? If not, I think we can
> >> use my patch first. Is it okay?
> >>
> >
> > Hi Stephen,
> >
> > Do you have comments for the bug fixing? I prefer to use my patch (clk:
> > fix initial state of critical clock's parents). How do you think?
> >
>
> How about we recalc accuracies and rates in addition to the patch
> from Mike? That will fix everything?
Hi Stephen,
It works!
I'll send a new series of MT2701 clock support in few days. Should I
include this patch in my series? Or you'll merge it into clk-next
directly?
Best regards,
James
> ---8<----
> From: Michael Turquette <mturquette@baylibre.com>
> Subject: [PATCH] clk: migrate ref counts when orphans are reunited
>
> It's always nice to see families reunited, and this is equally true when
> talking about parent clocks and their children. However, if the orphan
> clk had a positive prepare_count or enable_count, then we would not
> migrate those counts up the parent chain correctly.
>
> This has manifested with the recent critical clocks feature, which often
> enables clocks very early, before their parents have been registered.
>
> Fixed by replacing the call to clk_core_reparent with calls to
> __clk_set_parent_{before,after}.
>
> Cc: James Liao <jamesjj.liao@mediatek.com>
> Cc: Erin Lo <erin.lo@mediatek.com>
> Signed-off-by: Michael Turquette <mturquette@baylibre.com>
> [sboyd@codeaurora.org: Recalc accuracies and rates too]
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> ---
> drivers/clk/clk.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index 820a939fb6bb..dc3fff2bf839 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -2449,8 +2449,16 @@ static int __clk_core_init(struct clk_core *core)
> hlist_for_each_entry_safe(orphan, tmp2, &clk_orphan_list, child_node) {
> struct clk_core *parent = __clk_init_parent(orphan);
>
> - if (parent)
> - clk_core_reparent(orphan, parent);
> + /*
> + * we could call __clk_set_parent, but that would result in a
> + * reducant call to the .set_rate op, if it exists
> + */
> + if (parent) {
> + __clk_set_parent_before(orphan, parent);
> + __clk_set_parent_after(orphan, parent, NULL);
> + __clk_recalc_accuracies(orphan);
> + __clk_recalc_rates(orphan, 0);
> + }
> }
>
> /*
next prev parent reply other threads:[~2016-08-12 8:20 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-22 7:40 [PATCH v9 00/10] Add clock support for Mediatek MT2701 Erin Lo
2016-06-22 7:40 ` [PATCH v9 01/10] clk: fix initial state of critical clock's parents Erin Lo
2016-07-02 1:21 ` Stephen Boyd
2016-07-04 3:51 ` James Liao
2016-07-08 23:32 ` Michael Turquette
2016-07-09 0:46 ` Stephen Boyd
2016-07-11 8:24 ` James Liao
2016-08-03 5:46 ` James Liao
2016-08-09 5:39 ` James Liao
2016-08-10 21:09 ` Stephen Boyd
2016-08-12 8:17 ` James Liao [this message]
2016-08-13 0:39 ` Stephen Boyd
2016-08-15 2:47 ` James Liao
2016-06-22 7:40 ` [PATCH v9 02/10] clk: mediatek: remove __init from clk registration functions Erin Lo
2016-06-22 7:40 ` [PATCH v9 03/10] clk: mediatek: Refine the makefile to support multiple clock drivers Erin Lo
2016-08-13 0:41 ` Stephen Boyd
2016-06-22 7:40 ` [PATCH v9 04/10] dt-bindings: ARM: Mediatek: Document bindings for MT2701 Erin Lo
2016-06-22 7:40 ` [PATCH v9 05/10] clk: mediatek: Add dt-bindings for MT2701 clocks Erin Lo
2016-06-22 7:40 ` [PATCH v9 06/10] clk: mediatek: Add MT2701 clock support Erin Lo
2016-08-13 0:44 ` Stephen Boyd
2016-08-15 3:00 ` James Liao
2016-08-15 18:16 ` Stephen Boyd
2016-06-22 7:40 ` [PATCH v9 07/10] reset: mediatek: Add MT2701 reset controller dt-binding file Erin Lo
2016-06-22 7:40 ` [PATCH v9 08/10] reset: mediatek: Add MT2701 reset driver Erin Lo
2016-06-22 7:40 ` [PATCH v9 09/10] arm: dts: mt2701: Add clock controller device nodes Erin Lo
2016-06-22 7:40 ` [PATCH v9 10/10] arm: dts: mt2701: Use real clock for UARTs Erin Lo
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=1470989873.8551.10.camel@mtksdaap41 \
--to=jamesjj.liao@mediatek.com \
--cc=arnd@arndb.de \
--cc=devicetree@vger.kernel.org \
--cc=erin.lo@mediatek.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=mturquette@baylibre.com \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=sboyd@codeaurora.org \
--cc=srv_heupstream@mediatek.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).