From: Stephen Boyd <sboyd@kernel.org>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
Rob Herring <robh@kernel.org>,
Frank Rowand <frowand.list@gmail.com>,
Michael Turquette <mturquette@baylibre.com>,
devicetree@vger.kernel.org, linux-clk@vger.kernel.org,
linux-renesas-soc@vger.kernel.org,
Aymeric Aillet <aymeric.aillet@iot.bzh>,
Yusuke Goda <yusuke.goda.sx@renesas.com>
Subject: Re: [PATCH 4/4] drivers: clk: renesas: enable all clocks which is assinged to non Linux system
Date: Fri, 01 Dec 2023 22:39:49 +0000 [thread overview]
Message-ID: <d7cd97fb5dd2f320fbf52bf96b8fe79d.sboyd@kernel.org> (raw)
In-Reply-To: <871qca92s2.wl-kuninori.morimoto.gx@renesas.com>
Quoting Kuninori Morimoto (2023-11-27 23:48:04)
>
> Hi Stephen
>
> Thank you for your feedback
>
> > Does the protected-clocks property work? That basically says "don't use
> > these clks in the OS". The driver implementation would not register
> > those clks and then the framework would be unaware of their existence,
> > leading to them never being disabled during late init.
> >
> > This approach also looks OK to me, basically programmatically creating
> > the protected-clocks list by parsing DT for reserved consumer nodes and
> > then figuring out that no consumer exists so we can skip registering the
> > clk entirely, or add the flag. I'm not sure we want to implement that
> > policy globally, because maybe someone really wants to disable the clk
> > still to clean up bootloader state and then let a remoteproc use the clk
> > later.
> >
> > Do you want to keep those clks registered with the framework? Is there
> > any benefit to keeping clks around if linux can't do anything with them?
>
> Actually, this idea (= using "protected-clocks" property style) was our 1st
> idea, but I noticed that it is not enough. Because clock driver is possible
> to know which module was not used on Linux, but other driver can't, in this
> idea. For example, power-domain control driver might want to know about it.
>
> In case of using "protected-clocks" property, we need to have same/similar
> settings on each driver, but in case of using "status = reserved", all
> driver is possible to know it. It has consistent, and no contradict like
> some module was listed as "protected-clocks" on clock / power driver,
> but has "status = ok" on its driver, etc.
>
> It seems we have different opinions around here ?
I don't really have any opinion here.
>
> Our other idea was having "unassigned" node instead of
> "status = reserved", like below.
> clock driver checks "unassigned" node's "devices" property, and
> ignore/disable listed device's "clocks".
>
> unassigned {
> devices = <&scif1>, <&hsusb>;
> };
This approach looks like the chosen node. I'd say what you have done in
this patch series is better. The protected-clocks property is really
about clks that shouldn't be used by the OS on some board. In your case
it sounds like you want to still be able to read the clk hardware? Does
anything go wrong if you let some consumer get the clk and change
settings? Do you want to prevent that from happening? I'm mostly
thinking it may be useful to have this logic be common in the clk
framework by having the framework search through DT and figure out that
the only consumers are reserved and thus we should treat those clks as
read-only in the framework.
next prev parent reply other threads:[~2023-12-01 22:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-13 23:59 [PATCH 0/4] drivers: clk: renesas: enable all clocks which is assinged to non Linux system Kuninori Morimoto
2023-11-14 0:00 ` [PATCH 1/4] of: add __of_device_is_status() and makes more generic status check Kuninori Morimoto
2023-11-16 19:17 ` Rob Herring
2023-11-14 0:00 ` [PATCH 2/4] of: add __of_get_next_status_child() and makes more generic of_get_next Kuninori Morimoto
2023-11-14 0:01 ` [PATCH 3/4] of: add for_each_reserved_child_of_node() Kuninori Morimoto
2023-11-14 0:01 ` [PATCH 4/4] drivers: clk: renesas: enable all clocks which is assinged to non Linux system Kuninori Morimoto
2023-11-14 13:10 ` kernel test robot
2023-11-16 1:04 ` Kuninori Morimoto
2023-11-16 19:23 ` Rob Herring
2023-11-16 21:08 ` Geert Uytterhoeven
2023-11-27 21:32 ` Stephen Boyd
2023-11-27 23:48 ` Kuninori Morimoto
2023-12-01 22:39 ` Stephen Boyd [this message]
2023-12-04 0:26 ` Kuninori Morimoto
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=d7cd97fb5dd2f320fbf52bf96b8fe79d.sboyd@kernel.org \
--to=sboyd@kernel.org \
--cc=aymeric.aillet@iot.bzh \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=geert@linux-m68k.org \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=robh@kernel.org \
--cc=yusuke.goda.sx@renesas.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 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).