From: Marek Vasut <marex@denx.de>
To: Rob Herring <robh@kernel.org>
Cc: linux-clk@vger.kernel.org,
Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
devicetree@vger.kernel.org, linux-power@fi.rohmeurope.com
Subject: Re: [PATCH] [RFC] dt-bindings: clk: Introduce 'critical-clocks' property
Date: Tue, 15 Feb 2022 11:31:34 +0100 [thread overview]
Message-ID: <8406fe5c-9d79-db12-38ef-792683d88afb@denx.de> (raw)
In-Reply-To: <YaU1oThMxsBJj+re@robh.at.kernel.org>
On 11/29/21 21:18, Rob Herring wrote:
> On Mon, Nov 08, 2021 at 11:42:42PM +0100, Marek Vasut wrote:
>> NOTE: This is an RFC patch showing how this mechanism might be workable.
>>
>> Some platforms require clock to be always running, e.g. because those clock
>> supply devices which are not otherwise attached to the system. One example
>> is a system where the SoC serves as a crystal oscillator replacement for a
>> programmable logic device. The critical-clock property of a clock controller
>> allows listing clock which must never be turned off.
>>
>> The implementation here is similar to "protected-clock", except protected
>> clock property is currently driver specific. This patch attempts to make
>> a generic implementation of "critical-clock" instead.
>>
>> Unlike "assigned-clocks", the "critical-clock" must be parsed much earlier
>> in __clk_register() to assign CLK_IS_CRITICAL flag to clk_init_data .flags
>> field. The parsing code obviously need to be cleaned up and factor out into
>> separate function.
>>
>> The new match_clkspec() callback is used to determine whether struct clk_hw
>> that is currently being registered matches the clock specifier in the DT
>> "critical-clock" property, and if so, then the CLK_IS_CRITICAL is added to
>> these newly registered clock. This callback is currently driver specific,
>> although I suspect a common and/or generic version of the callback could
>> be added. Also, this new callback could possibly be used to replace (*get)
>> argument of of_clk_add_hw_provider() later on too.
>>
>> Thoughts (on the overall design, not code quality or patch splitting) ?
>>
>> Signed-off-by: Marek Vasut <marex@denx.de>
>> Cc: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
>> Cc: Michael Turquette <mturquette@baylibre.com>
>> Cc: Rob Herring <robh+dt@kernel.org>
>> Cc: Stephen Boyd <sboyd@kernel.org>
>> Cc: devicetree@vger.kernel.org
>> Cc: linux-power@fi.rohmeurope.com
>> To: linux-clk@vger.kernel.org
>> ---
>> .../bindings/clock/clock-bindings.txt | 16 ++++++++++++
>> drivers/clk/clk-bd718x7.c | 15 +++++++++++
>> drivers/clk/clk.c | 25 +++++++++++++++++++
>> include/linux/clk-provider.h | 2 ++
>> 4 files changed, 58 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/clock/clock-bindings.txt b/Documentation/devicetree/bindings/clock/clock-bindings.txt
>> index f2ea53832ac63..d9a783c35c5a1 100644
>> --- a/Documentation/devicetree/bindings/clock/clock-bindings.txt
>> +++ b/Documentation/devicetree/bindings/clock/clock-bindings.txt
>> @@ -169,6 +169,22 @@ a shared clock is forbidden.
>> Configuration of common clocks, which affect multiple consumer devices can
>> be similarly specified in the clock provider node.
>>
>> +==Critical clocks==
>> +
>> +Some platforms require clock to be always running, e.g. because those clock
>> +supply devices which are not otherwise attached to the system. One example
>> +is a system where the SoC serves as a crystal oscillator replacement for a
>> +programmable logic device. The critical-clock property of a clock controller
>> +allows listing clock which must never be turned off.
>> +
>> + clock-controller@a000f000 {
>> + compatible = "vendor,clk95;
>> + reg = <0xa000f000 0x1000>
>> + #clocks-cells = <1>;
>> + ...
>> + critical-clocks = <UART3_CLK>, <SPI5_CLK>;
>
> This will need a schema definition in dtschema.
>
> Otherwise, the concept is fine for me.
I sent out proper patches, also for the schemas.
prev parent reply other threads:[~2022-02-15 10:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-08 22:42 [PATCH] [RFC] dt-bindings: clk: Introduce 'critical-clocks' property Marek Vasut
2021-11-12 6:56 ` Vaittinen, Matti
2021-11-29 20:18 ` Rob Herring
2022-02-15 10:31 ` Marek Vasut [this message]
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=8406fe5c-9d79-db12-38ef-792683d88afb@denx.de \
--to=marex@denx.de \
--cc=devicetree@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-power@fi.rohmeurope.com \
--cc=matti.vaittinen@fi.rohmeurope.com \
--cc=mturquette@baylibre.com \
--cc=robh@kernel.org \
--cc=sboyd@kernel.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).