linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Doug Anderson <dianders@chromium.org>
To: Stephen Boyd <sboyd@kernel.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Andy Gross <agross@kernel.org>,
	dhavalp@codeaurora.org, mturney@codeaurora.org,
	Rajendra Nayak <rnayak@codeaurora.org>,
	Ravi Kumar Bokka <rbokka@codeaurora.org>,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>,
	Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>,
	sparate@codeaurora.org, mkurumel@codeaurora.org,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
	<devicetree@vger.kernel.org>,
	LKML" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 2/4] dt-bindings: nvmem: Add properties needed for blowing fuses
Date: Thu, 18 Jun 2020 10:25:00 -0700	[thread overview]
Message-ID: <CAD=FV=Unm8RK9GDNyuRZjznT21ef=jqcqhMXUWDV6HPkhn3coQ@mail.gmail.com> (raw)
In-Reply-To: <159249930746.62212.6196028697481604160@swboyd.mtv.corp.google.com>

Hi,

On Thu, Jun 18, 2020 at 9:55 AM Stephen Boyd <sboyd@kernel.org> wrote:
>
> Quoting Doug Anderson (2020-06-18 08:32:20)
> > Hi,
> >
> > On Thu, Jun 18, 2020 at 7:01 AM Srinivas Kandagatla
> > >
> > > On the other note:
> > >
> > > clock-names are not mandatory according to
> > > Documentation/devicetree/bindings/clock/clock-bindings.txt
> > >
> > > For this particular case where clock-names = "sec" is totally used for
> > > indexing and nothing else!
> >
> > So I guess in the one-clock case it's more optional and if you feel
> > strongly I'll get rid of clk-names here.  ...but if we ever need
> > another clock we probably will want to add it back and (I could be
> > corrected) I believe it's convention to specify clk-names even with
> > one clock.
>
> TL;DR: I suggest you call this "core" if you want to keep the
> clock-name, or just drop it if there's only one clk and move on.

Ah, true.  "core" sounds good.


> It's not required to have clock-names with one clk, and indeed it's not
> required to have clock-names at all. The multi clk scenario is a little
> more difficult to handle because historically the clk_get() API has been
> name based and not index based like platform resources. When there is
> one clk the driver can pass NULL as the 'con_id' argument to clk_get()
> and it will do the right thing. And when you have more than one clk you
> can pass NULL still and get the first clk, that should be in the same
> index, and then other clks by name.
>
> So far nobody has added clk_get_by_index() but I suppose if it was
> important the API could be added. Working with only legacy clkdev
> lookups would fail of course, but clock-names could be fully deprecated
> and kernel images may be smaller because we're not storing piles of
> strings and doing string comparisons. Given that it's been this way for
> a long time and we have DT schema checking it doesn't seem very
> important to mandate anything one way or the other though. I certainly
> don't feel good when I see of_clk_*() APIs being used by platform
> drivers, but sometimes it is required.
>
> To really put this into perspective, consider the fact that most drivers
> have code that figures out what clk names to look for and then they pile
> them into arrays and just turn them all on and off together. Providing
> fine grained clk control here is a gigantic waste of time, and requiring
> clock-names is just more hoops that driver authors feel they have to
> jump through for $reasons. We have clk_bulk_get_all() for this, but that
> doesn't solve the one rate changing clk among the sea of clk gates
> problem. In general, driver authors don't care and we should probably be
> providing a richer while simpler API to them that manages power state of
> some handful of clks, regulators, and power domains for a device while
> also letting them control various knobs like clk rate when necessary.
>
> BTW, on qcom platforms they usually name clks "core" and "iface" for the
> core clk and the interface clk used to access the registers of a device.
> Sometimes there are esoteric ones like "axi". In theory this cuts down
> on the number of strings the kernel keeps around but I like that it
> helps provide continuity across drivers and DTs for their SoCs. If you
> ask the hardware engineer what the clk name is for the hardware block
> they'll tell you the globally unique clk name like
> "gcc_qupv3_uart9_core_clk", which is the worst name to use.

OK, sounds about what I expected.  I suppose the path of least
resistance would be to just drop clock-names.  I guess I'm just
worried that down the road someone will want to specify the "iface"
clock too.  If that ever happens, we're stuck with these options:

1. Be the first ones to require adding clk_get_by_index().

2. Use the frowned upon of_clk_get() API which allows getting by index.

3. Get the first clock with clk_get(NULL) and the second clock with
clk_get("iface") and figure out how to specify this happily in the
yaml.

If we just define clock-names now then we pretty much match the
pattern of everyone else.


Srinivas: reading all that if you still want me to drop clock-names
then I will.  I'll use clk_get(NULL) to get the clock and if/when we
ever need an "iface" clock (maybe we never will?) we can figure it out
then.


-Doug

  parent reply	other threads:[~2020-06-18 17:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17 14:51 [PATCH v3 0/4] nvmem: qfprom: Patches for fuse blowing on Qualcomm SoCs Douglas Anderson
2020-06-17 14:51 ` [PATCH v3 1/4] dt-bindings: nvmem: qfprom: Convert to yaml Douglas Anderson
2020-06-17 15:18   ` Srinivas Kandagatla
2020-06-17 16:26     ` Ravi Kumar Bokka (Temp)
2020-06-17 17:28       ` Doug Anderson
2020-06-18 18:43   ` Rob Herring
2020-06-17 14:51 ` [PATCH v3 2/4] dt-bindings: nvmem: Add properties needed for blowing fuses Douglas Anderson
2020-06-17 15:19   ` Srinivas Kandagatla
2020-06-17 17:22     ` Doug Anderson
2020-06-18 10:10       ` Srinivas Kandagatla
2020-06-18 13:48         ` Doug Anderson
2020-06-18 14:01           ` Srinivas Kandagatla
2020-06-18 15:32             ` Doug Anderson
     [not found]               ` <159249930746.62212.6196028697481604160@swboyd.mtv.corp.google.com>
2020-06-18 17:25                 ` Doug Anderson [this message]
2020-06-19  9:22                   ` Srinivas Kandagatla
2020-06-17 14:51 ` [PATCH v3 3/4] nvmem: qfprom: Add fuse blowing support Douglas Anderson
2020-06-17 15:03   ` Jeffrey Hugo
2020-06-17 15:18   ` Srinivas Kandagatla
2020-06-17 17:13     ` Doug Anderson
2020-06-23 13:35   ` Pavel Machek
2020-06-23 14:48     ` Doug Anderson
2020-06-17 14:51 ` [PATCH v3 4/4] arm64: dts: qcom: sc7180: Add properties to qfprom for fuse blowing Douglas Anderson

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='CAD=FV=Unm8RK9GDNyuRZjznT21ef=jqcqhMXUWDV6HPkhn3coQ@mail.gmail.com' \
    --to=dianders@chromium.org \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=dhavalp@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkurumel@codeaurora.org \
    --cc=mturney@codeaurora.org \
    --cc=rbokka@codeaurora.org \
    --cc=rnayak@codeaurora.org \
    --cc=robh+dt@kernel.org \
    --cc=saiprakash.ranjan@codeaurora.org \
    --cc=sboyd@kernel.org \
    --cc=sparate@codeaurora.org \
    --cc=srinivas.kandagatla@linaro.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).