public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: "Heiko Stübner" <heiko@sntech.de>
To: Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	linux-clk@vger.kernel.org,
	Sebastian Reichel <sebastian.reichel@collabora.com>
Cc: Elaine Zhang <zhangqing@rock-chips.com>,
	Kever Yang <kever.yang@rock-chips.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	huangtao@rock-chips.com, andy.yan@rock-chips.com,
	Michal Tomek <mtdev79b@gmail.com>, Ilya K <me@0upti.me>,
	Chad LeClair <leclair@gmail.com>,
	devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	kernel@collabora.com
Subject: Re: [PATCH v9 2/7] clk: rockchip: handle missing clocks with -EPROBE_DEFER
Date: Sat, 31 Aug 2024 12:48:54 +0200	[thread overview]
Message-ID: <2405227.9fHWaBTJ5E@diego> (raw)
In-Reply-To: <20240325193609.237182-3-sebastian.reichel@collabora.com>

Am Montag, 25. März 2024, 20:33:33 CEST schrieb Sebastian Reichel:
> In the future some clocks will be registered using CLK_OF_DECLARE
> and some are registered later from the driver probe routine. Any
> clock handled by the probe routine should return -EPROBE_DEFER
> until that routine has been called.

So this changes the behaviour for misconfigured systems/devicetrees.
Before a driver would get the ENOENT if they requested a clock from an
empty lookup field, but now they will just defer forever.

Can we do some rockchip_clk_finalize() that runs after _all_ clocks are
registered (in the CLK_OF_DECLARE function for most drivers, at the end
of probe for i.e. rk3588) that takes all lookup entries that are still
EPROBE_DEFER and set it to ENOENT again please?


Thanks
Heiko


> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> ---
>  drivers/clk/rockchip/clk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/rockchip/clk.c b/drivers/clk/rockchip/clk.c
> index 73d2cbdc716b..31b7cc243d82 100644
> --- a/drivers/clk/rockchip/clk.c
> +++ b/drivers/clk/rockchip/clk.c
> @@ -376,7 +376,7 @@ struct rockchip_clk_provider *rockchip_clk_init(struct device_node *np,
>  		goto err_free;
>  
>  	for (i = 0; i < nr_clks; ++i)
> -		clk_table[i] = ERR_PTR(-ENOENT);
> +		clk_table[i] = ERR_PTR(-EPROBE_DEFER);
>  
>  	ctx->reg_base = base;
>  	ctx->clk_data.clks = clk_table;
> 





  reply	other threads:[~2024-08-31 10:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25 19:33 [PATCH v9 0/7] rockchip: clk: add GATE_LINK support Sebastian Reichel
2024-03-25 19:33 ` [PATCH v9 1/7] clk: rockchip: rk3588: drop unused code Sebastian Reichel
2024-03-25 19:33 ` [PATCH v9 2/7] clk: rockchip: handle missing clocks with -EPROBE_DEFER Sebastian Reichel
2024-08-31 10:48   ` Heiko Stübner [this message]
2024-03-25 19:33 ` [PATCH v9 3/7] clk: rockchip: rk3588: register GATE_LINK later Sebastian Reichel
2024-03-25 19:33 ` [PATCH v9 4/7] clk: rockchip: expose rockchip_clk_set_lookup Sebastian Reichel
2024-03-25 19:33 ` [PATCH v9 5/7] clk: rockchip: fix error for unknown clocks Sebastian Reichel
2024-03-25 19:33 ` [PATCH v9 6/7] clk: rockchip: implement linked gate clock support Sebastian Reichel
2024-09-02 14:03   ` Heiko Stübner
2024-03-25 19:33 ` [PATCH v9 7/7] clk: rockchip: rk3588: drop RK3588_LINKED_CLK Sebastian Reichel
2024-08-30 15:13 ` (subset) [PATCH v9 0/7] rockchip: clk: add GATE_LINK support Heiko Stuebner

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=2405227.9fHWaBTJ5E@diego \
    --to=heiko@sntech.de \
    --cc=andy.yan@rock-chips.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=huangtao@rock-chips.com \
    --cc=kernel@collabora.com \
    --cc=kever.yang@rock-chips.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=leclair@gmail.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=me@0upti.me \
    --cc=mtdev79b@gmail.com \
    --cc=mturquette@baylibre.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=sebastian.reichel@collabora.com \
    --cc=zhangqing@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