From: Brian Masney <bmasney@redhat.com>
To: "Stefan Dösinger" <stefandoesinger@gmail.com>
Cc: Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Vinod Koul <vkoul@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Russell King <linux@armlinux.org.uk>, Lee Jones <lee@kernel.org>,
linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-phy@lists.infradead.org, mfd@lists.linux.dev
Subject: Re: [PATCH v8 05/12] clk: zte: Add Clock registration infrastructure
Date: Thu, 30 Jul 2026 13:38:08 -0400 [thread overview]
Message-ID: <amuMADxexEuJJG44@redhat.com> (raw)
In-Reply-To: <MwDLqBgXR7G6dGkTtCaRrQ@gmail.com>
Hi Stefan,
On Wed, Jul 29, 2026 at 12:25:34AM +0300, Stefan Dösinger wrote:
> Thanks for the review!
>
> Am Dienstag, 28. Juli 2026, 16:53:17 Ostafrikanische Zeit schrieben Sie:
> > Looking into the other patches. There's more mixing of the clk provider
> > calling the clk consumer APIs here. It looks like this just takes a
> > reference and holds them. Would moving to parent_data address this?
>
> I think so. parent_data::fw_name is indeed something I have been looking for
> and didn't stumble across myself. And I suspect when you say "use
> parent_data", you don't mean "use parent_data.name everywhere".
>
> But it raises the question of how to handle internal clocks, e.g. foo_gate-
> >foo_div->foo_mux->clock-26m. Only "clock-26m" is passed through the DT and
> found via fw_name, and only foo_gate is exported.
>
> For the other clocks I currently rely on the string matching to resolve the
> parent named in the static init data to an actual registered clk_hw. The
> alternative I see is storing the struct clk_hw * in a table by index and pass
> it in parent_data.hw, but that'd require managing the extra indices. Or build
> a clock-local name->clk_hw lookup, but then I am just reinventing the old name
> matching.
>
> Am I missing something obvious? Is there a canonical implementation somewhere
> that implements modern best practices? I learned that looking at existing
> drivers isn't always a reliable guide.
You'll want to register all of the clocks with the subsystem. Take a
look at drivers/clk/qcom/gcc-sa8775p.c and here's an example I picked
at random that shows how you can reference the parents with the
parent_data:
static const struct clk_parent_data gcc_parent_data_8[] = {
{ .index = DT_BI_TCXO },
{ .hw = &gcc_gpll7.clkr.hw },
{ .index = DT_RXC1_REF_CLK },
{ .hw = &gcc_gpll0_out_even.clkr.hw },
};
static struct clk_rcg2 gcc_emac1_rgmii_clk_src = {
...
.clkr.hw.init = &(const struct clk_init_data){
.name = "gcc_emac1_rgmii_clk_src",
.parent_data = gcc_parent_data_8,
.num_parents = ARRAY_SIZE(gcc_parent_data_8),
.ops = &clk_rcg2_shared_ops,
},
};
Brian
next prev parent reply other threads:[~2026-07-30 17:38 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 18:24 [PATCH v8 00/12] ZTE zx297520v3 clock bindings and driver Stefan Dösinger
2026-07-27 18:24 ` [PATCH v8 01/12] dt-bindings: clk: zte: Add zx297520v3 top clock and reset controller Stefan Dösinger
2026-07-28 6:27 ` Krzysztof Kozlowski
2026-07-28 18:10 ` Stefan Dösinger
2026-07-30 6:19 ` Krzysztof Kozlowski
2026-07-27 18:24 ` [PATCH v8 02/12] dt-bindings: clk: zte: Add zx297520v3 matrix " Stefan Dösinger
2026-07-28 6:31 ` Krzysztof Kozlowski
2026-07-27 18:24 ` [PATCH v8 03/12] dt-bindings: clk: zte: Add zx297520v3 LSP " Stefan Dösinger
2026-07-27 18:24 ` [PATCH v8 04/12] mfd: zx297520v3: Add a clock and reset MFD driver Stefan Dösinger
2026-07-27 18:24 ` [PATCH v8 05/12] clk: zte: Add Clock registration infrastructure Stefan Dösinger
2026-07-28 13:38 ` Brian Masney
2026-07-28 13:53 ` Brian Masney
2026-07-28 21:25 ` Stefan Dösinger
2026-07-30 17:38 ` Brian Masney [this message]
2026-07-27 18:24 ` [PATCH v8 06/12] clk: zte: Add regmap-based clocks Stefan Dösinger
2026-07-28 13:42 ` Brian Masney
2026-07-27 18:24 ` [PATCH v8 07/12] clk: zte: Add zx PLL support infrastructure Stefan Dösinger
2026-07-27 18:24 ` [PATCH v8 08/12] clk: zte: Introduce a driver for zx297520v3 top clocks Stefan Dösinger
2026-07-27 18:24 ` [PATCH v8 09/12] clk: zte: Introduce a driver for zx297520v3 matrix clocks Stefan Dösinger
2026-07-27 18:24 ` [PATCH v8 10/12] clk: zte: Introduce a driver for zx297520v3 LSP clocks Stefan Dösinger
2026-07-27 18:24 ` [PATCH v8 11/12] reset: zte: Add a zx297520v3 reset driver Stefan Dösinger
2026-07-27 18:24 ` [PATCH v8 12/12] ARM: dts: zte: Declare zx297520v3 CRM device nodes Stefan Dösinger
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=amuMADxexEuJJG44@redhat.com \
--to=bmasney@redhat.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lee@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=mfd@lists.linux.dev \
--cc=mturquette@baylibre.com \
--cc=neil.armstrong@linaro.org \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=stefandoesinger@gmail.com \
--cc=vkoul@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