devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Marek Vasut <marex@denx.de>, linux-clk@vger.kernel.org
Cc: Marek Vasut <marex@denx.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Rob Herring <robh+dt@kernel.org>,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v3 2/2] clk: Introduce 'critical-clocks' property
Date: Wed, 15 Jun 2022 13:33:29 -0700	[thread overview]
Message-ID: <20220615203331.1E4C3C3411A@smtp.kernel.org> (raw)
In-Reply-To: <20220517235919.200375-2-marex@denx.de>

Quoting Marek Vasut (2022-05-17 16:59:19)
> Some platforms require select clock to be always running, e.g. because
> those clock supply vital devices which are not otherwise attached to
> the system and thus do not have a matching DT node and clock consumer.
> 
> An example is a system where the SoC serves as a crystal oscillator
> replacement for a programmable logic device. The "critical-clocks"
> property of a clock controller allows listing clock which must never
> be turned off.
> 
> Clock listed in the "critical-clocks" property may have other consumers
> in DT, listing the clock in "critical-clocks" only assures those clock
> are never turned off, and none of these optional additional consumers
> can turn the clock off either. This is achieved by adding CLK_IS_CRITICAL
> flag to these critical clock.
> 
> This flag has thus far been added to select clock by hard-coding it in
> various clock drivers, this patch provides generic DT interface to add
> the flag to arbitrary clock that may be critical.
> 
> The implementation is modeled after "protected-clocks", except the protected
> clock property is currently driver specific. This patch attempts to provide
> a generic implementation of "critical-clocks" instead.
> 
> Unlike "assigned-clocks", the "critical-clocks" must be parsed much earlier
> in __clk_register() to assign CLK_IS_CRITICAL flag to clk_init_data .flags
> field.

Why? Instead of using the CLK_IS_CRITICAL flag to enable at registration
time for this, why can't we parse the property when a clk provider is
registered and enable those clks manually and then set the
CLK_IS_CRITICAL flag? Ideally we don't implement another clk_op for
this.

> 
> 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-clocks" property, and if so, then the CLK_IS_CRITICAL is added to
> these newly registered clock. This callback can only be driver specific.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>

  reply	other threads:[~2022-06-15 20:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17 23:59 [PATCH v3 1/2] dt-bindings: clk: Introduce 'critical-clocks' property Marek Vasut
2022-05-17 23:59 ` [PATCH v3 2/2] " Marek Vasut
2022-06-15 20:33   ` Stephen Boyd [this message]
2022-06-01 19:58 ` [PATCH v3 1/2] dt-bindings: " Rob Herring
2022-06-15 20:10 ` Stephen Boyd
2022-06-15 21:55   ` Marek Vasut
2022-06-15 22:22     ` Stephen Boyd
2022-06-15 23:42       ` Marek Vasut
2022-06-16  0:14         ` Stephen Boyd

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=20220615203331.1E4C3C3411A@smtp.kernel.org \
    --to=sboyd@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=mturquette@baylibre.com \
    --cc=robh+dt@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).