linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	Chen-Yu Tsai <wenst@chromium.org>
Cc: Michael Turquette <mturquette@baylibre.com>,
	Chun-Jie Chen <chun-jie.chen@mediatek.com>,
	Miles Chen <miles.chen@mediatek.com>,
	Rex-BC Chen <rex-bc.chen@mediatek.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	linux-clk@vger.kernel.org, linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 0/7] clk: mediatek: Move to struct clk_hw provider APIs
Date: Thu, 21 Apr 2022 18:40:42 -0700	[thread overview]
Message-ID: <20220422014044.16530C385A7@smtp.kernel.org> (raw)
In-Reply-To: <CAGXv+5G2Uyq5fdMUnhr5wOm6O8M3dHNKGaSP2L_Vv1o28mXmOQ@mail.gmail.com>

Quoting Chen-Yu Tsai (2022-04-20 23:05:10)
> 
> Not exactly. All the clocks in the MTK drivers are allocated at runtime,
> so we can't use clk_parent_data to point to not-yet-allocated clk_hw-s.
> Instead we'll need to have
> 
>     struct mtk_clk_parent_data {
>         unsigned int clk_id; /* Match CLK_XXX_YYY from dt-binding headers */
>         ... /* remaining fields same as mtk_clk_parent_data */
>     };
> 
> and create the actual clk_parent_data at runtime by looking up clk_id in
> the set of already registered clks:
> 
>     int mtk_clk_register_XXX(..., struct mtk_clk_parent_data *pdata,
>                              struct clk_hw_onecell_data *clk_data) {
>         struct clk_parent_data data = {
>             .hw = clk_data[pdata->clk_id],
>             /* copy other fields verbatim */
>         };
>         ...
>     }
> 
> Obviously this forces some ordering of how the clks are registered.
> I believe the order is already correct, and if it isn't, it would be
> easy to detect, and we can reorder things to fix it.

If this is a common problem, we may need to come up with a generic
solution that either adds a new clk registration API that fills in the
clk_parent_data hw pointer or add another member to struct
clk_parent_data that says "index into this other array of clk_hw
pointers".

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2022-04-22  1:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19  8:12 [RFC PATCH 0/7] clk: mediatek: Move to struct clk_hw provider APIs Chen-Yu Tsai
2022-04-19  8:12 ` [RFC PATCH 1/7] clk: mediatek: Make mtk_clk_register_composite() static Chen-Yu Tsai
2022-04-19 14:45   ` AngeloGioacchino Del Regno
2022-04-19  8:12 ` [RFC PATCH 2/7] clk: mediatek: apmixed: Drop error message from clk_register() failure Chen-Yu Tsai
2022-04-19  8:12 ` [RFC PATCH 3/7] clk: mediatek: Convert mtk_{alloc, free}_clk_data to struct clk_hw Chen-Yu Tsai
2022-04-19  8:12 ` [RFC PATCH 5/7] clk: mediatek: Switch to clk_hw provider APIs Chen-Yu Tsai
2022-04-19  8:12 ` [RFC PATCH 6/7] clk: mediatek: mt8173: Fix usage of mtk_clk_register_ref2usb_tx() Chen-Yu Tsai
2022-04-19  8:12 ` [RFC PATCH 7/7] clk: mediatek: mt8173: Switch to clk_hw provider APIs Chen-Yu Tsai
2022-04-19 15:08 ` [RFC PATCH 0/7] clk: mediatek: Move to struct " AngeloGioacchino Del Regno
2022-04-19 16:09   ` Chen-Yu Tsai
2022-04-20 12:02     ` AngeloGioacchino Del Regno
2022-04-21  6:05       ` Chen-Yu Tsai
2022-04-21  9:42         ` AngeloGioacchino Del Regno
2022-04-22  1:40         ` Stephen Boyd [this message]
2022-04-22  4:14           ` Chen-Yu Tsai
2022-05-03 16:28 ` Chen-Yu Tsai

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=20220422014044.16530C385A7@smtp.kernel.org \
    --to=sboyd@kernel.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chun-jie.chen@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=miles.chen@mediatek.com \
    --cc=mturquette@baylibre.com \
    --cc=rex-bc.chen@mediatek.com \
    --cc=wenst@chromium.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;
as well as URLs for NNTP newsgroup(s).