All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: linux-clk@vger.kernel.org,
	Michael Turquette <mturquette@baylibre.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [RESEND PATCH v2 12/16] clk: avoid circular clock topology
Date: Mon, 1 Feb 2016 17:08:14 -0800	[thread overview]
Message-ID: <20160202010814.GA4848@codeaurora.org> (raw)
In-Reply-To: <1451298191-30815-13-git-send-email-yamada.masahiro@socionext.com>

On 12/28, Masahiro Yamada wrote:
> Currently, clk_register() never checks a circular parent looping,
> but clock providers could register such an insane clock topology.
> For example, "clk_a" could have "clk_b" as a parent, and vice versa.
> In this case, clk_core_reparent() creates a circular parent list
> and __clk_recalc_accuracies() calls itself recursively forever.
> 
> The core infrastructure should be kind enough to bail out, showing
> an appropriate error message in such a case.  This helps to easily
> find a bug in clock providers.  (uh, I made such a silly mistake
> when I was implementing my clock providers first.  I was upset
> because the kernel did not respond, without any error message.)
> 
> This commit adds a new helper function, __clk_is_ancestor().  It
> returns true if the second argument is a possible ancestor of the
> first one.  If a clock core is a possible ancestor of itself, it
> would make a loop when it were registered.  That should be detected
> as an error.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---

Applied to clk-next

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply	other threads:[~2016-02-02  1:08 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-28 10:22 [RESEND PATCH v2 00/16] clk: a collection of various clean-ups and improvements Masahiro Yamada
2015-12-28 10:22 ` [RESEND PATCH v2 01/16] clk: remove unused first argument of __clk_init() Masahiro Yamada
2016-01-08  0:44   ` Vladimir Zapolskiy
2016-01-08  3:56     ` Masahiro Yamada
2016-02-02  1:07   ` Stephen Boyd
2015-12-28 10:22 ` [RESEND PATCH v2 02/16] clk: change the argument of __clk_init() into pointer to clk_core Masahiro Yamada
2016-02-02  1:07   ` Stephen Boyd
2015-12-28 10:22 ` [RESEND PATCH v2 03/16] clk: rename __clk_init() into __clk_core_init() Masahiro Yamada
2016-02-02  1:07   ` Stephen Boyd
2015-12-28 10:22 ` [RESEND PATCH v2 04/16] clk: remove unnecessary !core->parents conditional Masahiro Yamada
2016-02-02  1:07   ` Stephen Boyd
2015-12-28 10:22 ` [RESEND PATCH v2 05/16] clk: change sizeof(struct clk *) to sizeof(*core->parents) Masahiro Yamada
2016-02-02  1:07   ` Stephen Boyd
2015-12-28 10:23 ` [RESEND PATCH v2 06/16] clk: move core->parents allocation to clk_register() Masahiro Yamada
2016-02-02  0:23   ` Stephen Boyd
2016-02-02  1:07   ` Stephen Boyd
2015-12-28 10:23 ` [RESEND PATCH v2 07/16] clk: simplify clk_core_get_parent_by_index() Masahiro Yamada
2016-02-02  1:07   ` Stephen Boyd
2015-12-28 10:23 ` [RESEND PATCH v2 08/16] clk: drop the initial core->parents look-ups from __clk_core_init() Masahiro Yamada
2016-02-02  0:25   ` Stephen Boyd
2016-02-02  1:07   ` Stephen Boyd
2015-12-28 10:23 ` [RESEND PATCH v2 09/16] clk: replace pr_warn() with pr_err() for fatal cases Masahiro Yamada
2016-02-02  1:07   ` Stephen Boyd
2015-12-28 10:23 ` [RESEND PATCH v2 10/16] clk: move checking .git_parent to __clk_core_init() Masahiro Yamada
2016-02-02  0:50   ` Stephen Boyd
2016-02-02  2:19     ` Masahiro Yamada
2016-02-02  2:39       ` Stephen Boyd
2016-02-02  2:48         ` Masahiro Yamada
2016-02-02 20:43           ` Stephen Boyd
2016-02-03  2:09             ` Masahiro Yamada
2016-02-02  1:08   ` Stephen Boyd
2015-12-28 10:23 ` [RESEND PATCH v2 11/16] clk: simplify __clk_init_parent() Masahiro Yamada
2016-02-02  1:08   ` Stephen Boyd
2015-12-28 10:23 ` [RESEND PATCH v2 12/16] clk: avoid circular clock topology Masahiro Yamada
2016-02-02  1:08   ` Stephen Boyd [this message]
2015-12-28 10:23 ` [RESEND PATCH v2 13/16] clk: walk the orphan clock list more simply Masahiro Yamada
2016-02-02  1:08   ` Stephen Boyd
2015-12-28 10:23 ` [RESEND PATCH v2 14/16] clk: make sure parent is not NULL in clk_fetch_parent_index() Masahiro Yamada
2016-02-02  1:08   ` Stephen Boyd
2015-12-28 10:23 ` [RESEND PATCH v2 15/16] clk: simplify clk_fetch_parent_index() function Masahiro Yamada
2016-02-02  1:08   ` Stephen Boyd
2015-12-28 10:23 ` [RESEND PATCH v2 16/16] clk: slightly optimize clk_core_set_parent() Masahiro Yamada
2016-02-02  1:08   ` Stephen Boyd
2016-01-04 23:57 ` [RESEND PATCH v2 00/16] clk: a collection of various clean-ups and improvements Michael Turquette
2016-01-04 23:57   ` Michael Turquette

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=20160202010814.GA4848@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.