[PATCH 3/4] pmdomain: rockchip: don't ignore clock lookup errors on attach
Sebastian Reichel
sebastian.reichel at collabora.com
Fri Sep 18 10:59:08 PDT 2026
Hi,
On Fri, Sep 18, 2026 at 08:07:37PM +0800, Shawn Lin wrote:
> rockchip_pd_attach_dev() treated every of_clk_get() error as the end
> of the clock list, so a clock that exists but is not available yet
> (e.g. -EPROBE_DEFER) was silently skipped and the device ended up
> without pm_clk management. Only -ENOENT means there are no more
> clocks.
>
> Fixes: 7c696693a4f5 ("soc: rockchip: power-domain: Add power domain driver")
> Signed-off-by: Shawn Lin <shawn.lin at rock-chips.com>
> ---
Reviewed-by: Sebastian Reichel <sebastian.reichel at collabora.com>
-- Sebastian
> drivers/pmdomain/rockchip/pm-domains.c | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pmdomain/rockchip/pm-domains.c b/drivers/pmdomain/rockchip/pm-domains.c
> index b6b099b..e193f97 100644
> --- a/drivers/pmdomain/rockchip/pm-domains.c
> +++ b/drivers/pmdomain/rockchip/pm-domains.c
> @@ -759,7 +759,19 @@ static int rockchip_pd_attach_dev(struct generic_pm_domain *genpd,
> }
>
> i = 0;
> - while ((clk = of_clk_get(dev->of_node, i++)) && !IS_ERR(clk)) {
> + while (1) {
> + clk = of_clk_get(dev->of_node, i++);
> + if (IS_ERR(clk)) {
> + error = PTR_ERR(clk);
> + if (error == -ENOENT)
> + break;
> +
> + dev_err(dev, "failed to get clock %d: %d\n", i - 1,
> + error);
> + pm_clk_destroy(dev);
> + return error;
> + }
> +
> dev_dbg(dev, "adding clock '%pC' to list of PM clocks\n", clk);
> error = pm_clk_add_clk(dev, clk);
> if (error) {
> --
> 2.7.4
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-rockchip/attachments/20260918/c14c86c2/attachment.sig>
More information about the Linux-rockchip
mailing list