[PATCH v9 2/7] clk: rockchip: handle missing clocks with -EPROBE_DEFER

Heiko Stübner heiko at sntech.de
Sat Aug 31 03:48:54 PDT 2024


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 at 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;
> 







More information about the Linux-rockchip mailing list