From: Lee Jones <lee.jones@linaro.org>
To: Michael Turquette <mturquette@baylibre.com>
Cc: linux-clk@vger.kernel.org, sboyd@codeaurora.org,
maxime.ripard@free-electrons.com, maxime.coquelin@st.com,
geert@linux-m68k.org, heiko@sntech.de, andre.przywara@arm.com,
rklein@nvidia.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v42 1/6] clk: Allow clocks to be marked as CRITICAL
Date: Fri, 12 Feb 2016 08:03:25 +0000 [thread overview]
Message-ID: <20160212080325.GL20693@x1> (raw)
In-Reply-To: <1455225554-13267-2-git-send-email-mturquette@baylibre.com>
On Thu, 11 Feb 2016, Michael Turquette wrote:
> From: Lee Jones <lee.jones@linaro.org>
>
> Critical clocks are those which must not be gated, else undefined
> or catastrophic failure would occur. Here we have chosen to
> ensure the prepare/enable counts are correctly incremented, so as
> not to confuse users with enabled clocks with no visible users.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Michael Turquette <mturquette@baylibre.com>
> ---
> Changes in v42:
> * Moved code from clk_register into __clk_init
I'm happy with this change. Thanks Mike!
> drivers/clk/clk.c | 5 +++++
> include/linux/clk-provider.h | 1 +
> 2 files changed, 6 insertions(+)
>
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index b4db67a..993f775 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -2484,6 +2484,11 @@ static int __clk_init(struct device *dev, struct clk *clk_user)
> if (core->ops->init)
> core->ops->init(core->hw);
>
> + if (core->flags & CLK_IS_CRITICAL) {
> + clk_core_prepare(core);
> + clk_core_enable(core);
> + }
> +
> kref_init(&core->ref);
> out:
> clk_prepare_unlock();
> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
> index 1143e38..1d986ea 100644
> --- a/include/linux/clk-provider.h
> +++ b/include/linux/clk-provider.h
> @@ -32,6 +32,7 @@
> #define CLK_GET_ACCURACY_NOCACHE BIT(8) /* do not use the cached clk accuracy */
> #define CLK_RECALC_NEW_RATES BIT(9) /* recalc rates after notifications */
> #define CLK_SET_RATE_UNGATE BIT(10) /* clock needs to run to set rate */
> +#define CLK_IS_CRITICAL BIT(11) /* do not gate, ever */
>
> struct clk;
> struct clk_hw;
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
next prev parent reply other threads:[~2016-02-12 8:03 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-11 21:19 [PATCH v42 0/6] critical clocks and handoff clocks Michael Turquette
2016-02-11 21:19 ` [PATCH v42 1/6] clk: Allow clocks to be marked as CRITICAL Michael Turquette
2016-02-12 8:03 ` Lee Jones [this message]
2016-02-13 1:14 ` Stephen Boyd
[not found] ` <20160215202734.2278.91610@quark.deferred.io>
2016-02-19 2:03 ` Stephen Boyd
2016-02-11 21:19 ` [PATCH v42 2/6] clk: WARN_ON about to disable a critical clock Michael Turquette
2016-02-13 1:14 ` Stephen Boyd
2016-02-11 21:19 ` [PATCH v42 3/6] clk: Provide OF helper to mark clocks as CRITICAL Michael Turquette
2016-02-12 8:02 ` Lee Jones
[not found] ` <20160330171542.23150.23031@quark.deferred.io>
2016-03-31 9:14 ` Lee Jones
2016-02-13 1:09 ` Stephen Boyd
2016-02-11 21:19 ` [PATCH v42 4/6] clk: per-user clk prepare & enable ref counts Michael Turquette
2016-02-13 1:16 ` Stephen Boyd
2016-02-11 21:19 ` [PATCH v42 5/6] clk: clk_put WARNs if user has not disabled clk Michael Turquette
2016-02-13 1:18 ` Stephen Boyd
2016-02-14 14:51 ` Geert Uytterhoeven
2016-02-11 21:19 ` [PATCH v42 6/6] clk: introduce CLK_ENABLE_HAND_OFF flag Michael Turquette
2016-02-12 8:06 ` [PATCH v42 0/6] critical clocks and handoff clocks Lee Jones
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=20160212080325.GL20693@x1 \
--to=lee.jones@linaro.org \
--cc=andre.przywara@arm.com \
--cc=geert@linux-m68k.org \
--cc=heiko@sntech.de \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.coquelin@st.com \
--cc=maxime.ripard@free-electrons.com \
--cc=mturquette@baylibre.com \
--cc=rklein@nvidia.com \
--cc=sboyd@codeaurora.org \
/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).