Linux clock framework development
 help / color / mirror / Atom feed
From: "elaine.zhang" <zhangqing@rock-chips.com>
To: Stephen Boyd <sboyd@kernel.org>, Heiko Stuebner <heiko@sntech.de>
Cc: mturquette@baylibre.com, linux-clk@vger.kernel.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
	xxx@rock-chips.com, xf@rock-chips.com, huangtao@rock-chips.com,
	kever.yang@rock-chips.com
Subject: Re: [PATCH v1] clk: Export __clk_lookup()
Date: Thu, 23 Jul 2020 09:49:35 +0800	[thread overview]
Message-ID: <99eebfa5-e775-37a8-6c76-90ae2444b253@rock-chips.com> (raw)
In-Reply-To: <f3e7b8f3-e4d4-9965-703d-aa4b96f50f6d@rock-chips.com>


在 2020/7/23 上午9:42, elaine.zhang 写道:
>
> 在 2020/7/23 上午8:51, Stephen Boyd 写道:
>> Quoting Heiko Stuebner (2020-07-22 11:26:50)
>>> Hi Elaine,
>>>
>>> Am Mittwoch, 22. Juli 2020, 04:32:30 CEST schrieb Elaine Zhang:
>>>> Export __clk_lookup() to support user built as module.
>>>>
>>>> ERROR:
>>>> drivers/clk/rockchip/clk.ko: In function
>>>> `rockchip_clk_protect_critical':
>>>> drivers/clk/rockchip/clk.c:741:
>>>> undefined reference to `__clk_lookup'
>>> can you elaborate a bit more on why this would be needed?
>>>
>>> Because right now the Rockchip clocks are of course built into
>>> the main kernel image (especially due to them being needed during early
>>> boot) and __clk_lookup actually is a pretty deep part of the clock-
>>> framework itself, as probably also denoted by the "__" in the function
>>> name.
>>>
>> Can you stop using __clk_lookup()? The plan is to remove it.
>
> Rk use  __clk_lookup() as:
>
> drivers/clk/rockchip/clk.c
>
> void __init rockchip_clk_protect_critical(const char *const clocks[],
>                                           int nclocks)
> {
>         int i;
>
>         /* Protect the clocks that needs to stay on */
>         for (i = 0; i < nclocks; i++) {
>                 struct clk *clk = __clk_lookup(clocks[i]);
>
>                 if (clk)
>                         clk_prepare_enable(clk);
>         }
> }
> e.g:
>
> drivers/clk/rockchip/clk-rk3328.c
>
> static const char *const rk3328_critical_clocks[] __initconst = {
>         "aclk_bus",
>         "aclk_bus_niu",
>         "pclk_bus",
>         "pclk_bus_niu",
>         "hclk_bus",
>         "hclk_bus_niu",
>         "aclk_peri",
> ............
>
> };
>
> If have plan to remove the __clk_lookup, I need to replace the 
> rockchip_clk_protect_critical, and use the flag CLK_IS_CRITICAL.(but 
> use flag CLK_IS_CRITICAL, the enable count is always "0")
Use the CLK_IS_CRITICAL, there is no guarantee that the parent clk is 
enabled, So the flag CLK_IS_CRITICAL need to be added to all special 
clks according to the clk tree.
>
>>
>>



  reply	other threads:[~2020-07-23  1:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-22  2:32 [PATCH v1] clk: Export __clk_lookup() Elaine Zhang
2020-07-22 18:26 ` Heiko Stuebner
2020-07-23  0:51   ` Stephen Boyd
2020-07-23  1:42     ` elaine.zhang
2020-07-23  1:49       ` elaine.zhang [this message]
2020-07-23  3:36   ` elaine.zhang

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=99eebfa5-e775-37a8-6c76-90ae2444b253@rock-chips.com \
    --to=zhangqing@rock-chips.com \
    --cc=heiko@sntech.de \
    --cc=huangtao@rock-chips.com \
    --cc=kever.yang@rock-chips.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    --cc=xf@rock-chips.com \
    --cc=xxx@rock-chips.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