devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Chen Wang <unicorn_wang@outlook.com>,
	Chen Wang <unicornxw@gmail.com>,
	aou@eecs.berkeley.edu, chao.wei@sophgo.com, conor@kernel.org,
	devicetree@vger.kernel.org, guoren@kernel.org,
	haijiao.liu@sophgo.com, inochiama@outlook.com,
	jszhang@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-riscv@lists.infradead.org, mturquette@baylibre.com,
	palmer@dabbelt.com, paul.walmsley@sifive.com,
	richardcochran@gmail.com, robh+dt@kernel.org,
	samuel.holland@sifive.com, xiaoguang.xing@sophgo.com
Subject: Re: [PATCH v13 4/5] clk: sophgo: Add SG2042 clock driver
Date: Thu, 11 Apr 2024 22:55:05 -0700	[thread overview]
Message-ID: <58956ebc474b993e6da1d6689ecb9324.sboyd@kernel.org> (raw)
In-Reply-To: <MA0P287MB2822BC109267BD20922FB581FE052@MA0P287MB2822.INDP287.PROD.OUTLOOK.COM>

Quoting Chen Wang (2024-04-11 05:58:05)
> 
> On 2024/4/11 12:11, Stephen Boyd wrote:
> > Quoting Chen Wang (2024-03-28 23:21:40)
> >> +static const u32 sg2042_mux_table[] = {1, 0};
> >> +
> >> +static const char *const clk_mux_ddr01_p[] = {
> >> +                       "clk_div_ddr01_0", "clk_div_ddr01_1"};
> >> +static const char *const clk_mux_ddr23_p[] = {
> >> +                       "clk_div_ddr23_0", "clk_div_ddr23_1"};
> >> +static const char *const clk_mux_rp_cpu_normal_p[] = {
> >> +                       "clk_div_rp_cpu_normal_0", "clk_div_rp_cpu_normal_1"};
> >> +static const char *const clk_mux_axi_ddr_p[] = {
> >> +                       "clk_div_axi_ddr_0", "clk_div_axi_ddr_1"};
> >> +
> >> +static struct sg2042_mux_clock sg2042_mux_clks[] = {
> >> +       SG2042_MUX(MUX_CLK_DDR01, "clk_mux_ddr01", clk_mux_ddr01_p,
> > Please use struct clk_parent_data or struct clk_hw directly instead of
> > string names.
> 
> Hi, Stephen,
> 
> I understand that for clk_init_data, parent_names/parent_data/parent_hws 
> are all acceptable. Why do you only suggest me to use 
> parent_data/parent_hws here? Can you please explain?

Using parent_names requires a global string search for that clk. Using
clk_parent_data or parent_hws reduces that search significantly,
speeding things up. Not using any strings furthermore speeds it up, i.e.
using an index when the clk is external to the device and a clk_hw
pointer when the clk is internal to the device. We speed things up by
removing string comparisons, of which there are many. Any new code
should be using direct pointers or an index, no strings.

  reply	other threads:[~2024-04-12  5:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-29  6:19 [PATCH v13 0/5] riscv: sophgo: add clock support for sg2042 Chen Wang
2024-03-29  6:20 ` [PATCH v13 1/5] dt-bindings: clock: sophgo: add pll clocks for SG2042 Chen Wang
2024-03-29  6:20 ` [PATCH v13 2/5] dt-bindings: clock: sophgo: add RP gate " Chen Wang
2024-03-29  6:21 ` [PATCH v13 3/5] dt-bindings: clock: sophgo: add clkgen " Chen Wang
2024-03-29  6:21 ` [PATCH v13 4/5] clk: sophgo: Add SG2042 clock driver Chen Wang
2024-04-04  1:04   ` Chen Wang
2024-04-11  4:11   ` Stephen Boyd
2024-04-11 12:58     ` Chen Wang
2024-04-12  5:55       ` Stephen Boyd [this message]
2024-04-12 10:23     ` Chen Wang
2024-03-29  6:21 ` [PATCH v13 5/5] riscv: dts: add clock generator for Sophgo SG2042 SoC Chen Wang

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=58956ebc474b993e6da1d6689ecb9324.sboyd@kernel.org \
    --to=sboyd@kernel.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=chao.wei@sophgo.com \
    --cc=conor@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=guoren@kernel.org \
    --cc=haijiao.liu@sophgo.com \
    --cc=inochiama@outlook.com \
    --cc=jszhang@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mturquette@baylibre.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=richardcochran@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=samuel.holland@sifive.com \
    --cc=unicorn_wang@outlook.com \
    --cc=unicornxw@gmail.com \
    --cc=xiaoguang.xing@sophgo.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).