All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yao Zi <me@ziyao.cc>
To: Sergey Shtylyov <s.shtylyov@auroraos.dev>, Yao Zi <me@ziyao.cc>,
	Ulf Hansson <ulfh@kernel.org>, Heiko Stuebner <heiko@sntech.de>,
	Shawn Lin <shawn.lin@rock-chips.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	Midgy BALON <midgy971@gmail.com>,
	Finley Xiao <finley.xiao@rock-chips.com>,
	Frank Zhang <rmxpzlb@gmail.com>,
	Chris Morgan <macromorgan@hotmail.com>,
	Kevin Hilman <khilman@linaro.org>,
	Caesar Wang <wxt@rock-chips.com>,
	Elaine Zhang <zhangqing@rock-chips.com>
Cc: <linux-pm@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-rockchip@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <stable@vger.kernel.org>
Subject: Re: [PATCH 2/2] pmdomain: rockchip: Don't log when of_clk_get() fails with -EPROBE_DEFER
Date: Fri, 6 Nov 2026 08:50:06 +0000	[thread overview]
Message-ID: <au2UvnY0CdGTRnum@pie> (raw)
In-Reply-To: <71b77625-8475-43da-a62b-983cf572229d@auroraos.dev>

On Thu, Nov 05, 2026 at 11:47:13PM +0300, Sergey Shtylyov wrote:
> Hello!
> 
>    Please consider using --no-git-fallback with scripts/get_maintainer.pl --
> I don't see what do I have to do with this patch (other than fixing another
> bug in this driver earlier).

Thanks for the reminder, I usually enable it but forgot it this time, sorry
for disturbing...

> On 11/5/26 3:12 AM, Yao Zi wrote:
> 
> > Current error handling code considers -EPROBE_DEFER as hard errors,
> > logs misleading dmesg like,
> > 
> > rockchip-pm-domain ff600000.power-management:power-controller: power-domain: failed to get clk at index 0: -517
> > rockchip-pm-domain ff600000.power-management:power-controller: failed to handle node power-domain: -517
> > 
> > Use dev_err_probe() at the callsite of of_clk_get(),
> 
> > and check for -EPROBE_DEFER in places> where its return value could propagate to.
> 
>    To where?

rockchip_pm_add_one_domain, rockchip_pm_add_subdomain, and
rockchip_pm_domain_probe. I think it's obvious in the diff and too
detailed to the commit message, so didn't add them here.

>    And I didn't understand why you couldn't just call dev_err_probe() everywhere --
> the error code seems to always be propagated...

This was what I originally wanted to do, but dev_err_probe() sets the
deferred probe reason, and if we call it several times, the earlier and
more specific messagess ("failed to get clk at index %d") get overridden
by the later and less descriptive ones ("failed to handle subdomain node
%pOFn"), which I think would make it harder to debug.

> > Fixes: 7c696693a4f5 ("soc: rockchip: power-domain: Add power domain driver")
> > Fixes: 6be05b5ec161 ("soc: rockchip: power-domain: add support for sub-power domains")
> > Signed-off-by: Yao Zi <me@ziyao.cc>
> > Cc: stable@vger.kernel.org
> > ---
> >  drivers/pmdomain/rockchip/pm-domains.c | 22 +++++++++++++---------
> >  1 file changed, 13 insertions(+), 9 deletions(-)
> > 
> > diff --git a/drivers/pmdomain/rockchip/pm-domains.c b/drivers/pmdomain/rockchip/pm-domains.c
> > index 34c862e56aad..c147cc88edb1 100644
> > --- a/drivers/pmdomain/rockchip/pm-domains.c
> > +++ b/drivers/pmdomain/rockchip/pm-domains.c
> [...]> @@ -1006,8 +1006,10 @@ static int rockchip_pm_add_subdomain(struct rockchip_pmu *pmu,
> > 
> >                 error = rockchip_pm_add_one_domain(pmu, np);
> >                 if (error) {
> > -                       dev_err(pmu->dev, "failed to handle node %pOFn: %d\n",
> > -                               np, error);
> > +                       if (error != -EPROBE_DEFER)
> 
>    Why not just call dev_err_probe() instead?
> 
> > +                               dev_err(pmu->dev,
> > +                                       "failed to handle node %pOFn: %d\n",
> > +                                       np, error);
> >                         return error;
> >                 }
> > 
> > @@ -1102,15 +1104,17 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev)
> >         for_each_available_child_of_node_scoped(np, node) {
> >                 error = rockchip_pm_add_one_domain(pmu, node);
> >                 if (error) {
> > -                       dev_err(dev, "failed to handle node %pOFn: %d\n",
> > -                               node, error);
> > +                       if (error != -EPROBE_DEFER)
> > +                               dev_err(dev, "failed to handle node %pOFn: %d\n",
> > +                                       node, error);
> >                         goto err_out;
> >                 }
> > 
> >                 error = rockchip_pm_add_subdomain(pmu, node);
> >                 if (error < 0) {
> > -                       dev_err(dev, "failed to handle subdomain node %pOFn: %d\n",
> > -                               node, error);
> > +                       if (error != -EPROBE_DEFER)
> > +                               dev_err(dev, "failed to handle subdomain node %pOFn: %d\n",
> > +                                       node, error);
> >                         goto err_out;
> >                 }
> >         }
> [...]
> 
> MBR, Sergey
> 

Regards,
Yao Zi


WARNING: multiple messages have this Message-ID (diff)
From: Yao Zi <me@ziyao.cc>
To: Sergey Shtylyov <s.shtylyov@auroraos.dev>, Yao Zi <me@ziyao.cc>,
	Ulf Hansson <ulfh@kernel.org>, Heiko Stuebner <heiko@sntech.de>,
	Shawn Lin <shawn.lin@rock-chips.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	Midgy BALON <midgy971@gmail.com>,
	Finley Xiao <finley.xiao@rock-chips.com>,
	Frank Zhang <rmxpzlb@gmail.com>,
	Chris Morgan <macromorgan@hotmail.com>,
	Kevin Hilman <khilman@linaro.org>,
	Caesar Wang <wxt@rock-chips.com>,
	Elaine Zhang <zhangqing@rock-chips.com>
Cc: <linux-pm@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-rockchip@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <stable@vger.kernel.org>
Subject: Re: [PATCH 2/2] pmdomain: rockchip: Don't log when of_clk_get() fails with -EPROBE_DEFER
Date: Fri, 6 Nov 2026 08:50:06 +0000	[thread overview]
Message-ID: <au2UvnY0CdGTRnum@pie> (raw)
In-Reply-To: <71b77625-8475-43da-a62b-983cf572229d@auroraos.dev>

On Thu, Nov 05, 2026 at 11:47:13PM +0300, Sergey Shtylyov wrote:
> Hello!
> 
>    Please consider using --no-git-fallback with scripts/get_maintainer.pl --
> I don't see what do I have to do with this patch (other than fixing another
> bug in this driver earlier).

Thanks for the reminder, I usually enable it but forgot it this time, sorry
for disturbing...

> On 11/5/26 3:12 AM, Yao Zi wrote:
> 
> > Current error handling code considers -EPROBE_DEFER as hard errors,
> > logs misleading dmesg like,
> > 
> > rockchip-pm-domain ff600000.power-management:power-controller: power-domain: failed to get clk at index 0: -517
> > rockchip-pm-domain ff600000.power-management:power-controller: failed to handle node power-domain: -517
> > 
> > Use dev_err_probe() at the callsite of of_clk_get(),
> 
> > and check for -EPROBE_DEFER in places> where its return value could propagate to.
> 
>    To where?

rockchip_pm_add_one_domain, rockchip_pm_add_subdomain, and
rockchip_pm_domain_probe. I think it's obvious in the diff and too
detailed to the commit message, so didn't add them here.

>    And I didn't understand why you couldn't just call dev_err_probe() everywhere --
> the error code seems to always be propagated...

This was what I originally wanted to do, but dev_err_probe() sets the
deferred probe reason, and if we call it several times, the earlier and
more specific messagess ("failed to get clk at index %d") get overridden
by the later and less descriptive ones ("failed to handle subdomain node
%pOFn"), which I think would make it harder to debug.

> > Fixes: 7c696693a4f5 ("soc: rockchip: power-domain: Add power domain driver")
> > Fixes: 6be05b5ec161 ("soc: rockchip: power-domain: add support for sub-power domains")
> > Signed-off-by: Yao Zi <me@ziyao.cc>
> > Cc: stable@vger.kernel.org
> > ---
> >  drivers/pmdomain/rockchip/pm-domains.c | 22 +++++++++++++---------
> >  1 file changed, 13 insertions(+), 9 deletions(-)
> > 
> > diff --git a/drivers/pmdomain/rockchip/pm-domains.c b/drivers/pmdomain/rockchip/pm-domains.c
> > index 34c862e56aad..c147cc88edb1 100644
> > --- a/drivers/pmdomain/rockchip/pm-domains.c
> > +++ b/drivers/pmdomain/rockchip/pm-domains.c
> [...]> @@ -1006,8 +1006,10 @@ static int rockchip_pm_add_subdomain(struct rockchip_pmu *pmu,
> > 
> >                 error = rockchip_pm_add_one_domain(pmu, np);
> >                 if (error) {
> > -                       dev_err(pmu->dev, "failed to handle node %pOFn: %d\n",
> > -                               np, error);
> > +                       if (error != -EPROBE_DEFER)
> 
>    Why not just call dev_err_probe() instead?
> 
> > +                               dev_err(pmu->dev,
> > +                                       "failed to handle node %pOFn: %d\n",
> > +                                       np, error);
> >                         return error;
> >                 }
> > 
> > @@ -1102,15 +1104,17 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev)
> >         for_each_available_child_of_node_scoped(np, node) {
> >                 error = rockchip_pm_add_one_domain(pmu, node);
> >                 if (error) {
> > -                       dev_err(dev, "failed to handle node %pOFn: %d\n",
> > -                               node, error);
> > +                       if (error != -EPROBE_DEFER)
> > +                               dev_err(dev, "failed to handle node %pOFn: %d\n",
> > +                                       node, error);
> >                         goto err_out;
> >                 }
> > 
> >                 error = rockchip_pm_add_subdomain(pmu, node);
> >                 if (error < 0) {
> > -                       dev_err(dev, "failed to handle subdomain node %pOFn: %d\n",
> > -                               node, error);
> > +                       if (error != -EPROBE_DEFER)
> > +                               dev_err(dev, "failed to handle subdomain node %pOFn: %d\n",
> > +                                       node, error);
> >                         goto err_out;
> >                 }
> >         }
> [...]
> 
> MBR, Sergey
> 

Regards,
Yao Zi

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

  reply	other threads:[~2026-11-06  8:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05  0:12 [PATCH 0/2] Error and deferred probe fixes to Rockchip PM domain driver Yao Zi
2026-11-05  0:12 ` Yao Zi
2026-11-05  0:12 ` [PATCH 1/2] pmdomain: rockchip: Only put clocks that have been successfully obtained Yao Zi
2026-11-05  0:12   ` Yao Zi
2026-11-05  0:12 ` [PATCH 2/2] pmdomain: rockchip: Don't log when of_clk_get() fails with -EPROBE_DEFER Yao Zi
2026-11-05  0:12   ` Yao Zi
2026-11-05 20:47   ` Sergey Shtylyov
2026-11-05 20:47     ` Sergey Shtylyov
2026-11-06  8:50     ` Yao Zi [this message]
2026-11-06  8:50       ` Yao Zi
2026-11-06 20:37       ` Sergey Shtylyov
2026-11-06 20:37         ` Sergey Shtylyov

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=au2UvnY0CdGTRnum@pie \
    --to=me@ziyao.cc \
    --cc=finley.xiao@rock-chips.com \
    --cc=heiko@sntech.de \
    --cc=khilman@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=macromorgan@hotmail.com \
    --cc=midgy971@gmail.com \
    --cc=rmxpzlb@gmail.com \
    --cc=s.shtylyov@auroraos.dev \
    --cc=sebastian.reichel@collabora.com \
    --cc=shawn.lin@rock-chips.com \
    --cc=stable@vger.kernel.org \
    --cc=ulfh@kernel.org \
    --cc=wxt@rock-chips.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 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.