From: Stephen Boyd <sboyd@codeaurora.org>
To: Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@codeaurora.org>
Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>,
Masahiro Yamada <yamada.masahiro@socionext.com>
Subject: [PATCH] Revert "clk: avoid circular clock topology"
Date: Mon, 22 Feb 2016 15:19:23 -0800 [thread overview]
Message-ID: <1456183163-13595-1-git-send-email-sboyd@codeaurora.org> (raw)
In-Reply-To: <CAK7LNARhh0o8t_qLHc4_+yyZE6Hx6cwL2XEKbFsHZJmeHndzyA@mail.gmail.com>
This reverts commit 858d5881564026cbc4e6f5e25ae878a27df5d4c9.
Joachim reports that this commit breaks lpc18xx boot. This is
because the hardware has circular clk topology where PLLs can
feed into dividers and the same dividers can feed into the PLLs.
The hardware is designed this way so that you can choose to put
the divider before the PLL or after the PLL depending on what you
configure to be the parent of the divider and what you configure
to be the parent of the PLL.
So let's drop this patch for now because we have hardware that
actually has loops. A future patch could check for circular
parents when we change parents and fail the switch, but that's
probably best left to some debugging Kconfig option so that we
don't suffer the sanity checking cost all the time.
Reported-by: Joachim Eastwood <manabian@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
drivers/clk/clk.c | 40 ----------------------------------------
1 file changed, 40 deletions(-)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 58ef3dab894a..51d673370d42 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2242,38 +2242,6 @@ static inline void clk_debug_unregister(struct clk_core *core)
#endif
/**
- * __clk_is_ancestor - check if a clk_core is a possible ancestor of another
- * @core: clock core
- * @ancestor: ancestor clock core
- *
- * Returns true if there is a possibility that @ancestor can be an ancestor
- * of @core, false otherwise.
- *
- * This function can be used against @core or @ancestor that has not been
- * registered yet.
- */
-static bool __clk_is_ancestor(struct clk_core *core, struct clk_core *ancestor)
-{
- struct clk_core *parent;
- int i;
-
- for (i = 0; i < core->num_parents; i++) {
- parent = clk_core_get_parent_by_index(core, i);
- /*
- * If ancestor has not been added to clk_{root,orphan}_list
- * yet, clk_core_lookup() cannot find it. If parent is NULL,
- * compare the name strings, too.
- */
- if ((parent && (parent == ancestor ||
- __clk_is_ancestor(parent, ancestor))) ||
- (!parent && !strcmp(core->parent_names[i], ancestor->name)))
- return true;
- }
-
- return false;
-}
-
-/**
* __clk_core_init - initialize the data structures in a struct clk_core
* @core: clk_core being initialized
*
@@ -2338,14 +2306,6 @@ static int __clk_core_init(struct clk_core *core)
"%s: invalid NULL in %s's .parent_names\n",
__func__, core->name);
- /* If core is an ancestor of itself, it would make a loop. */
- if (__clk_is_ancestor(core, core)) {
- pr_err("%s: %s would create circular parent\n", __func__,
- core->name);
- ret = -EINVAL;
- goto out;
- }
-
core->parent = __clk_init_parent(core);
/*
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2016-02-22 23:19 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-28 10:10 [PATCH v2 00/16] clk: a collection of various clean-ups and improvements Masahiro Yamada
2015-12-28 10:10 ` [PATCH v2 01/16] clk: remove unused first argument of __clk_init() Masahiro Yamada
2015-12-28 10:10 ` [PATCH v2 02/16] clk: change the argument of __clk_init() into pointer to clk_core Masahiro Yamada
2015-12-28 10:10 ` [PATCH v2 03/16] clk: rename __clk_init() into __clk_core_init() Masahiro Yamada
2015-12-28 10:10 ` [PATCH v2 04/16] clk: remove unnecessary !core->parents conditional Masahiro Yamada
2015-12-28 10:10 ` [PATCH v2 05/16] clk: change sizeof(struct clk *) to sizeof(*core->parents) Masahiro Yamada
2015-12-28 10:10 ` [PATCH v2 06/16] clk: move core->parents allocation to clk_register() Masahiro Yamada
2015-12-28 10:10 ` [PATCH v2 07/16] clk: simplify clk_core_get_parent_by_index() Masahiro Yamada
2015-12-28 10:10 ` [PATCH v2 08/16] clk: drop the initial core->parents look-ups from __clk_core_init() Masahiro Yamada
2015-12-28 10:10 ` [PATCH v2 09/16] clk: replace pr_warn() with pr_err() for fatal cases Masahiro Yamada
2015-12-28 10:10 ` [PATCH v2 10/16] clk: move checking .git_parent to __clk_core_init() Masahiro Yamada
2015-12-28 10:10 ` [PATCH v2 11/16] clk: simplify __clk_init_parent() Masahiro Yamada
2015-12-28 10:10 ` [PATCH v2 12/16] clk: avoid circular clock topology Masahiro Yamada
2016-02-21 21:39 ` Joachim Eastwood
2016-02-22 2:29 ` Masahiro Yamada
2016-02-22 23:19 ` Stephen Boyd [this message]
2016-02-22 23:32 ` Joachim Eastwood
2015-12-28 10:10 ` [PATCH v2 13/16] clk: walk the orphan clock list more simply Masahiro Yamada
2015-12-28 10:10 ` [PATCH v2 14/16] clk: make sure parent is not NULL in clk_fetch_parent_index() Masahiro Yamada
2015-12-28 10:10 ` [PATCH v2 15/16] clk: simplify clk_fetch_parent_index() function Masahiro Yamada
2015-12-28 10:10 ` [PATCH v2 16/16] clk: slightly optimize clk_core_set_parent() Masahiro Yamada
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=1456183163-13595-1-git-send-email-sboyd@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=ezequiel@vanguardiasur.com.ar \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=yamada.masahiro@socionext.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
Powered by JetHome