From: Claudiu Beznea <claudiu.beznea@tuxon.dev>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org, magnus.damm@gmail.com,
linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Subject: Re: [PATCH 1/7] clk: renesas: rzg2l-cpg: Skip lookup of clock when searching for a sibling
Date: Wed, 7 May 2025 15:12:11 +0300 [thread overview]
Message-ID: <df05d999-8eba-4fbd-93f6-7919f73da11a@tuxon.dev> (raw)
In-Reply-To: <CAMuHMdWx9Xk5QksoGFvCyo2HLXZ_+WRBCe3bDrZx=bfPoXHJgg@mail.gmail.com>
Hi, Geert,
On 05.05.2025 18:52, Geert Uytterhoeven wrote:
> Hi Claudiu,
>
> On Thu, 10 Apr 2025 at 16:06, Claudiu <claudiu.beznea@tuxon.dev> wrote:
>> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>>
>> Since the sibling data is filled after the priv->clks[] array entry is
>> populated, the first clock that is probed and has a sibling will
>> temporarily behave as its own sibling until its actual sibling is
>> populated. To avoid any issues, skip this clock when searching for a
>> sibling.
>>
>> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> Thanks for your patch!
>
>> --- a/drivers/clk/renesas/rzg2l-cpg.c
>> +++ b/drivers/clk/renesas/rzg2l-cpg.c
>> @@ -1324,6 +1324,9 @@ static struct mstp_clock
>>
>> hw = __clk_get_hw(priv->clks[priv->num_core_clks + i]);
>> clk = to_mod_clock(hw);
>> + if (clk == clock)
>> + continue;
>> +
>> if (clock->off == clk->off && clock->bit == clk->bit)
>> return clk;
>> }
>
> Why not move the whole block around the call to
> rzg2l_mod_clock_get_sibling() up instead?
>
> ret = devm_clk_hw_register(dev, &clock->hw);
> if (ret) {
> clk = ERR_PTR(ret);
> goto fail;
> }
>
> - clk = clock->hw.clk;
> - dev_dbg(dev, "Module clock %pC at %lu Hz\n", clk,
> clk_get_rate(clk));
> - priv->clks[id] = clk;
> -
> if (mod->is_coupled) {
> struct mstp_clock *sibling;
>
> clock->enabled = rzg2l_mod_clock_is_enabled(&clock->hw);
> sibling = rzg2l_mod_clock_get_sibling(clock, priv);
> if (sibling) {
> clock->sibling = sibling;
> sibling->sibling = clock;
> }
> }
>
> + clk = clock->hw.clk;
> + dev_dbg(dev, "Module clock %pC at %lu Hz\n", clk,
> clk_get_rate(clk));
> + priv->clks[id] = clk;
> +
> return;
This should work as well. I considered the proposed patch generates less
diff. Please let me know if you prefer it addressed as you proposed.
Thank you for your review,
Claudiu
>
> Gr{oetje,eeting}s,
>
> Geert
>
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
next prev parent reply other threads:[~2025-05-07 12:12 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-10 14:06 [PATCH 0/7] clk: renesas: rzg2l-cpg: Drop PM domain abstraction for MSTOP Claudiu
2025-04-10 14:06 ` [PATCH 1/7] clk: renesas: rzg2l-cpg: Skip lookup of clock when searching for a sibling Claudiu
2025-05-05 15:52 ` Geert Uytterhoeven
2025-05-07 12:12 ` Claudiu Beznea [this message]
2025-05-08 13:55 ` Geert Uytterhoeven
2025-04-10 14:06 ` [PATCH 2/7] clk: renesas: rzg2l-cpg: Move pointers at the beginning of struct Claudiu
2025-05-05 15:53 ` Geert Uytterhoeven
2025-05-07 12:13 ` Claudiu Beznea
2025-04-10 14:06 ` [PATCH 3/7] clk: renesas: rzg2l-cpg: Add support for MSTOP in clock enable/disable API Claudiu
2025-05-07 15:42 ` Geert Uytterhoeven
2025-05-09 10:54 ` Claudiu Beznea
2025-05-09 12:34 ` Geert Uytterhoeven
2025-05-13 12:34 ` Claudiu Beznea
2025-05-13 14:07 ` Geert Uytterhoeven
2025-05-13 15:36 ` Claudiu Beznea
2025-05-07 15:47 ` Geert Uytterhoeven
2025-05-09 10:58 ` Claudiu Beznea
2025-05-09 12:12 ` Geert Uytterhoeven
2025-05-09 12:44 ` Claudiu Beznea
2025-04-10 14:06 ` [PATCH 4/7] clk: renesas: r9a08g045: Drop power domain instantiation Claudiu
2025-05-07 17:10 ` Geert Uytterhoeven
2025-05-09 11:03 ` Claudiu Beznea
2025-04-10 14:06 ` [PATCH 5/7] clk: renesas: rzg2l-cpg: Drop MSTOP based power domain support Claudiu
2025-05-07 17:15 ` Geert Uytterhoeven
2025-04-10 14:06 ` [PATCH 6/7] dt-bindings: clock: rzg2l-cpg: Drop power domain IDs Claudiu
2025-04-15 19:16 ` Rob Herring (Arm)
2025-05-07 17:17 ` Geert Uytterhoeven
2025-04-10 14:06 ` [PATCH 7/7] Revert "dt-bindings: clock: renesas,rzg2l-cpg: Update #power-domain-cells = <1> for RZ/G3S" Claudiu
2025-04-15 19:16 ` Rob Herring (Arm)
2025-05-07 17:18 ` Geert Uytterhoeven
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=df05d999-8eba-4fbd-93f6-7919f73da11a@tuxon.dev \
--to=claudiu.beznea@tuxon.dev \
--cc=claudiu.beznea.uj@bp.renesas.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=geert@linux-m68k.org \
--cc=krzk+dt@kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=mturquette@baylibre.com \
--cc=robh@kernel.org \
--cc=sboyd@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