[PATCH 2/2] pmdomain: rockchip: Don't log when of_clk_get() fails with -EPROBE_DEFER

Yao Zi me at ziyao.cc
Fri Nov 6 00:50:06 PST 2026


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 at ziyao.cc>
> > Cc: stable at 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



More information about the Linux-rockchip mailing list