From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: Shawn Lin <shawn.lin@rock-chips.com>
Cc: Ulf Hansson <ulfh@kernel.org>, Heiko Stuebner <heiko@sntech.de>,
linux-pm@vger.kernel.org, linux-rockchip@lists.infradead.org
Subject: Re: [PATCH 3/4] pmdomain: rockchip: don't ignore clock lookup errors on attach
Date: Fri, 18 Sep 2026 19:59:08 +0200 [thread overview]
Message-ID: <aq16yrdiWH95uYQ8@venus> (raw)
In-Reply-To: <1789733258-10133-4-git-send-email-shawn.lin@rock-chips.com>
[-- Attachment #1.1: Type: text/plain, Size: 1570 bytes --]
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@rock-chips.com>
> ---
Reviewed-by: Sebastian Reichel <sebastian.reichel@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
>
>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 170 bytes --]
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
WARNING: multiple messages have this Message-ID (diff)
From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: Shawn Lin <shawn.lin@rock-chips.com>
Cc: Ulf Hansson <ulfh@kernel.org>, Heiko Stuebner <heiko@sntech.de>,
linux-pm@vger.kernel.org, linux-rockchip@lists.infradead.org
Subject: Re: [PATCH 3/4] pmdomain: rockchip: don't ignore clock lookup errors on attach
Date: Fri, 18 Sep 2026 19:59:08 +0200 [thread overview]
Message-ID: <aq16yrdiWH95uYQ8@venus> (raw)
In-Reply-To: <1789733258-10133-4-git-send-email-shawn.lin@rock-chips.com>
[-- Attachment #1: Type: text/plain, Size: 1570 bytes --]
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@rock-chips.com>
> ---
Reviewed-by: Sebastian Reichel <sebastian.reichel@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
>
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2026-09-18 17:59 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 12:07 [PATCH 0/4] Small fixes and improvement for Rockchip pm-domains driver Shawn Lin
2026-09-18 12:07 ` [PATCH 1/4] pmdomain: rockchip: propagate subdomain add errors Shawn Lin
2026-09-18 12:07 ` Shawn Lin
2026-09-18 17:18 ` Sebastian Reichel
2026-09-18 17:18 ` Sebastian Reichel
2026-09-18 12:07 ` [PATCH 2/4] pmdomain: rockchip: fix clock leak on domain probe failure Shawn Lin
2026-09-18 12:07 ` Shawn Lin
2026-09-18 17:21 ` Sebastian Reichel
2026-09-18 17:21 ` Sebastian Reichel
2026-09-19 0:13 ` Shawn Lin
2026-09-19 0:13 ` Shawn Lin
2026-09-20 1:15 ` Shawn Lin
2026-09-20 1:15 ` Shawn Lin
2026-09-22 14:46 ` Sebastian Reichel
2026-09-22 14:46 ` Sebastian Reichel
2026-09-18 12:07 ` [PATCH 3/4] pmdomain: rockchip: don't ignore clock lookup errors on attach Shawn Lin
2026-09-18 12:07 ` Shawn Lin
2026-09-18 17:59 ` Sebastian Reichel [this message]
2026-09-18 17:59 ` Sebastian Reichel
2026-09-18 12:07 ` [PATCH 4/4] pmdomain: rockchip: drop duplicated errno from supply failure message Shawn Lin
2026-09-18 12:07 ` Shawn Lin
2026-09-18 17:54 ` Sebastian Reichel
2026-09-18 17:54 ` Sebastian Reichel
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=aq16yrdiWH95uYQ8@venus \
--to=sebastian.reichel@collabora.com \
--cc=heiko@sntech.de \
--cc=linux-pm@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=shawn.lin@rock-chips.com \
--cc=ulfh@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.