From: claudiu beznea <claudiu.beznea@tuxon.dev>
To: Stephen Boyd <sboyd@kernel.org>,
alexandre.belloni@bootlin.com, mripard@kernel.org,
mturquette@baylibre.com, nicolas.ferre@microchip.com
Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com
Subject: Re: [PATCH 03/42] clk: at91: sam9x60: switch to parent_hw and parent_data
Date: Wed, 2 Aug 2023 07:24:54 +0300 [thread overview]
Message-ID: <79a79ec5-3691-43d2-ca3e-478a94f85e2d@tuxon.dev> (raw)
In-Reply-To: <412f9209637e6eb861cd07e1d6dbc346.sboyd@kernel.org>
On 29.07.2023 06:28, Stephen Boyd wrote:
> Quoting Claudiu Beznea (2023-07-26 22:31:17)
>> @@ -177,31 +178,34 @@ static const struct {
>>
>> static void __init sam9x60_pmc_setup(struct device_node *np)
>> {
>> + struct clk_hw *td_slck_hw, *md_slck_hw, *main_xtal_hw, *main_rc_hw, *main_osc_hw;
>> + struct clk_hw *parent_hws[6], *hw, *usbck_hw;
>> + static struct clk_parent_data parent_data;
>> struct clk_range range = CLK_RANGE(0, 0);
>> - const char *td_slck_name, *md_slck_name, *mainxtal_name;
>> + const char *main_xtal_name = "main_xtal";
>> struct pmc_data *sam9x60_pmc;
>> - const char *parent_names[6];
>> - struct clk_hw *main_osc_hw;
>> struct regmap *regmap;
>> - struct clk_hw *hw;
>> + struct clk *clk;
>> int i;
>>
>> - i = of_property_match_string(np, "clock-names", "td_slck");
>> - if (i < 0)
>> + clk = of_clk_get_by_name(np, "td_slck");
>> + if (IS_ERR(clk))
>> return;
>> -
>> - td_slck_name = of_clk_get_parent_name(np, i);
>> -
>> - i = of_property_match_string(np, "clock-names", "md_slck");
>> - if (i < 0)
>> + td_slck_hw = __clk_get_hw(clk);
>
> Don't introduce more usage of __clk_get_hw(). The index for "td_slck"
> should be known, and it can be used as the index member in struct
> clk_parent_data. This allows the clk framework to lazily find the
> parent, instead of requiring the parent to be registered before this
> code runs. It also reduces the usage of __clk_get_hw().
If I'll do this I will have to also change the approach that has been done
for SAMA7G5 (already integrated in v6.5-rc1, maybe I had to let it more on
the mailing list before taking into the tree) for all the clock drivers
(basically instead of parent_hws I will have to provide parent_data to AT91
clock registration APIs AFAICT). No issue with that... just telling...
The reason I did it with parent_hws + __clk_get_hw() on PMC parents in
SAMA7G5 is that SAMA7G5 PLL parent rate need to be known from the
registration to setup properly the PLL. Otherwise PLL will not lock if not
properly setup. For this I got the parent_hw for PLL parent to retrieve its
rate and thus I chose at that time to also get the clk_hw for the other
parents of PMC just to have the same approach on all parents (and it looked
to me that code will be simpler).
Thank you for your review,
Claudiu Beznea
next prev parent reply other threads:[~2023-08-02 4:25 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-27 5:31 [PATCH 00/42] clk: at91: add support for parent_data and parent_hw (take #2) Claudiu Beznea
2023-07-27 5:31 ` [PATCH 01/42] clk: at91: sama7g5: check __clk_get_hw() argument for errors Claudiu Beznea
2023-07-27 5:31 ` [PATCH 02/42] clk: at91: clk-usb: add support for parent_hw Claudiu Beznea
2023-07-27 5:31 ` [PATCH 03/42] clk: at91: sam9x60: switch to parent_hw and parent_data Claudiu Beznea
2023-07-29 3:28 ` Stephen Boyd
2023-08-02 4:24 ` claudiu beznea [this message]
2023-09-09 0:06 ` Stephen Boyd
2023-07-27 5:31 ` [PATCH 04/42] clk: at91: sam9x60: make checkpatch.pl happy Claudiu Beznea
2023-07-27 5:31 ` [PATCH 05/42] clk: at91: clk-pll: add support for parent_hw Claudiu Beznea
2023-07-27 5:31 ` [PATCH 06/42] clk: at91: clk-audio-pll: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 07/42] clk: at91: clk-plldiv: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 08/42] clk: at91: clk-h32mx: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 09/42] clk: at91: clk-i2s-mux: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 10/42] clk: at91: sama5d2: switch to parent_hw and parent_data Claudiu Beznea
2023-07-27 5:31 ` [PATCH 11/42] clk: at91: clk-smd: add support for parent_hw Claudiu Beznea
2023-07-27 5:31 ` [PATCH 12/42] clk: at91: sama5d3: switch to parent_hw and parent_data Claudiu Beznea
2023-07-27 5:31 ` [PATCH 13/42] clk: at91: sama5d3: make checkpatch.pl happy Claudiu Beznea
2023-07-27 5:31 ` [PATCH 14/42] clk: at91: sama5d4: switch to parent_hw and parent_data Claudiu Beznea
2023-07-27 5:31 ` [PATCH 15/42] clk: at91: at91sam9x5: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 16/42] clk: at91: at91rm9200: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 17/42] clk: at91: at91rm9200: fix checkpatch.pl check Claudiu Beznea
2023-07-27 8:46 ` Krzysztof Kozlowski
2023-07-27 5:31 ` [PATCH 18/42] " Claudiu Beznea
2023-07-27 8:47 ` Krzysztof Kozlowski
2023-07-27 5:31 ` [PATCH 19/42] clk: at91: clk-slow: add support for parent_hw Claudiu Beznea
2023-07-27 5:31 ` [PATCH 20/42] clk: at91: at91sam9260: switch to parent_hw and parent_data Claudiu Beznea
2023-07-27 5:31 ` [PATCH 21/42] clk: at91: at91sam9g45: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 22/42] clk: at91: at91sam9g45: fix checkpatch.pl check Claudiu Beznea
2023-07-27 5:31 ` [PATCH 23/42] clk: at91: at91sam9n12: switch to parent_hw and parent_data Claudiu Beznea
2023-07-27 5:31 ` [PATCH 24/42] clk: at91: at91sam9n12: remove checkpatch.pl checks Claudiu Beznea
2023-07-27 5:31 ` [PATCH 25/42] clk: at91: at91sam9rl: switch to parent_hw Claudiu Beznea
2023-07-27 5:31 ` [PATCH 26/42] clk: at91: dt-compat: switch to parent_hw and parent_data Claudiu Beznea
2023-07-27 5:31 ` [PATCH 27/42] clk: at91: clk-audio-pll: remove parent_names support Claudiu Beznea
2023-07-27 5:31 ` [PATCH 28/42] clk: at91: clk-generated: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 29/42] clk: at91: clk-h32mx: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 30/42] clk: at91: clk-i2s-mux: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 31/42] clk: at91: clk-main: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 32/42] clk: at91: clk-master: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 33/42] clk: at91: clk-peripheral: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 34/42] clk: at91: clk-pll: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 35/42] clk: at91: clk-plldiv: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 36/42] clk: at91: clk-programmable: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 37/42] clk: at91: clk-sam9x60-pll: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 38/42] clk: at91: clk-slow: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 39/42] clk: at91: clk-smd: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 40/42] clk: at91: clk-system: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 41/42] clk: at91: clk-usb: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 42/42] clk: at91: clk-utmi: " Claudiu Beznea
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=79a79ec5-3691-43d2-ca3e-478a94f85e2d@tuxon.dev \
--to=claudiu.beznea@tuxon.dev \
--cc=alexandre.belloni@bootlin.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mripard@kernel.org \
--cc=mturquette@baylibre.com \
--cc=nicolas.ferre@microchip.com \
--cc=sboyd@kernel.org \
--cc=varshini.rajendran@microchip.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
all inboxes | Powered by JetHome®