From: Boris BREZILLON <b.brezillon@overkiz.com>
To: Gregory CLEMENT <gregory.clement@free-electrons.com>,
Mike Turquette <mturquette@linaro.org>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
Andrew Lunn <andrew@lunn.ch>, Jason Cooper <jason@lakedaemon.net>,
Ezequiel Garcia <ezequiel.garcia@free-electrons.com>,
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Boris BREZILLON <b.brezillon@overkiz.com>
Subject: [PATCH] clk: add strict of_clk_init dependency check
Date: Wed, 5 Feb 2014 10:48:00 +0100 [thread overview]
Message-ID: <1391593680-9388-1-git-send-email-b.brezillon@overkiz.com> (raw)
In-Reply-To: <1391554766-11285-1-git-send-email-gregory.clement@free-electrons.com>
The parent dependency check is only available on the first parent of a given
clk.
Add support for strict dependency check: all parents of a given clk must be
initialized.
Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
Hello Gregory,
This patch adds support for strict check on clk dependencies (check if all
parents specified by an DT clk node are initialized).
I'm not sure this is what you were expecting (maybe testing the first parent
is what you really want), so please feel free to tell me if I'm wrong.
Best Regards,
Boris
drivers/clk/clk.c | 27 +++++++++++++++++++++------
1 file changed, 21 insertions(+), 6 deletions(-)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index beb0f8b..6849769 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2543,22 +2543,37 @@ static int parent_ready(struct device_node *np)
{
struct of_phandle_args clkspec;
struct of_clk_provider *provider;
+ int num_parents;
+ bool found;
+ int i;
/*
* If there is no clock parent, no need to wait for them, then
* we can consider their absence as being ready
*/
- if (of_parse_phandle_with_args(np, "clocks", "#clock-cells", 0,
- &clkspec))
+ num_parents = of_count_phandle_with_args(np, "clocks", "#clock-cells");
+ if (num_parents <= 0)
return 1;
- /* Check if we have such a provider in our array */
- list_for_each_entry(provider, &of_clk_providers, link) {
- if (provider->node == clkspec.np)
+ for (i = 0; i < num_parents; i++) {
+ if (of_parse_phandle_with_args(np, "clocks", "#clock-cells", i,
+ &clkspec))
return 1;
+
+ /* Check if we have such a provider in our array */
+ found = false;
+ list_for_each_entry(provider, &of_clk_providers, link) {
+ if (provider->node == clkspec.np) {
+ found = true;
+ break;
+ }
+ }
+
+ if (!found)
+ return 0;
}
- return 0;
+ return 1;
}
/**
--
1.7.9.5
next prev parent reply other threads:[~2014-02-05 9:53 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-04 22:59 [PATCH] clk: respect the clock dependencies in of_clk_init Gregory CLEMENT
2014-02-05 5:09 ` Jason Cooper
2014-02-05 8:45 ` Boris BREZILLON
2014-02-05 9:48 ` Boris BREZILLON [this message]
2014-02-05 14:48 ` [PATCH] clk: add strict of_clk_init dependency check Gregory CLEMENT
2014-02-05 15:05 ` Gregory CLEMENT
2014-02-05 15:07 ` Boris BREZILLON
2014-02-05 23:11 ` [PATCH] clk: respect the clock dependencies in of_clk_init Sebastian Hesselbarth
2014-02-07 13:06 ` Emilio López
2014-02-07 14:24 ` Jason Cooper
2014-02-07 14:43 ` Ezequiel Garcia
2014-02-07 14:49 ` Gregory CLEMENT
2014-02-07 15:00 ` Emilio López
2014-02-07 15:12 ` Gregory CLEMENT
2014-02-07 16:16 ` Emilio López
2014-02-07 18:10 ` Gregory CLEMENT
2014-02-07 18:17 ` Emilio López
2014-02-07 23:15 ` Sebastian Hesselbarth
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=1391593680-9388-1-git-send-email-b.brezillon@overkiz.com \
--to=b.brezillon@overkiz.com \
--cc=andrew@lunn.ch \
--cc=ezequiel.garcia@free-electrons.com \
--cc=gregory.clement@free-electrons.com \
--cc=jason@lakedaemon.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@linaro.org \
--cc=sebastian.hesselbarth@gmail.com \
--cc=thomas.petazzoni@free-electrons.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
all inboxes | Powered by JetHome®