From: Yao Zi <me@ziyao.cc>
To: aiyengar1990@gmail.com, Ulf Hansson <ulfh@kernel.org>,
Heiko Stuebner <heiko@sntech.de>,
Shawn Lin <shawn.lin@rock-chips.com>,
Sebastian Reichel <sebastian.reichel@collabora.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,
Yao Zi <me@ziyao.cc>, Igor Pecovnik <igor@armbian.com>
Subject: Re: [PATCH v2 2/2] pmdomain: rockchip: report domain errors once, with dev_err_probe()
Date: Thu, 12 Nov 2026 10:52:43 +0000 [thread overview]
Message-ID: <avWae91pfLv9vyUv@pie> (raw)
In-Reply-To: <20261112-pmdomain-rockchip-v2-2-5cd942a23df7@gmail.com>
On Thu, Nov 12, 2026 at 08:23:30AM +0000, Arun Iyengar via B4 Relay wrote:
> From: Arun Iyengar <aiyengar1990@gmail.com>
>
> When a power domain clock is not available yet,
> rockchip_pm_add_one_domain() returns -EPROBE_DEFER, and both it and its
> callers rockchip_pm_domain_probe() and rockchip_pm_add_subdomain() print
> that with dev_err():
>
> rockchip-pm-domain ...: power-domain: failed to get clk at index 1: -517
> rockchip-pm-domain ...: failed to handle node power-domain: -517
>
> once per probe attempt, and the second line twice for a nested domain.
> On an RK3588 board whose NPU domain clock appears late this is more than
> 20 error lines before the domain finally probes, and the reason of the
> deferral is not recorded. Other failures are reported twice (once where
> they happen and once by the callers), or only by the callers, which name
> the node but not what failed: a missing pm_qos phandle and a pm_qos node
> without a regmap print nothing in rockchip_pm_add_one_domain(), and a
> failed clk_bulk_prepare() only has the message of the clk core, which
> names neither the device nor the domain.
>
> Report every error once, where it happens, with dev_err_probe(), and
> drop the "failed to handle (subdomain) node" messages from the callers.
> A deferral is then quiet and keeps its specific reason in
> /sys/kernel/debug/devices_deferred, such as "failed to get clk at index
> 1", and -ENOMEM, which the callers used to print, is quiet as well. The
> return values are unchanged, except that a failed
> syscon_node_to_regmap() for a pm_qos node now returns its own error
> instead of -ENODEV: it can be -EPROBE_DEFER (a syscon regmap that is
> not registered yet, or a syscon clock or hwlock that is not available
> yet), which must not turn into a probe failure.
>
> Fixes: 7c696693a4f5 ("soc: rockchip: power-domain: Add power domain driver")
> Fixes: 6be05b5ec161 ("soc: rockchip: power-domain: add support for sub-power domains")
> Suggested-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
> ---
> drivers/pmdomain/rockchip/pm-domains.c | 98 +++++++++++++++-------------------
> 1 file changed, 43 insertions(+), 55 deletions(-)
>
> diff --git a/drivers/pmdomain/rockchip/pm-domains.c b/drivers/pmdomain/rockchip/pm-domains.c
> index 00c7e78f89b5..be077fb52f40 100644
> --- a/drivers/pmdomain/rockchip/pm-domains.c
> +++ b/drivers/pmdomain/rockchip/pm-domains.c
> @@ -804,28 +804,22 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu,
> int error;
>
> error = of_property_read_u32(node, "reg", &id);
> - if (error) {
> - dev_err(pmu->dev,
> - "%pOFn: failed to retrieve domain id (reg): %d\n",
> - node, error);
> - return -EINVAL;
> - }
> + if (error)
> + return dev_err_probe(pmu->dev, -EINVAL,
> + "%pOFn: failed to retrieve domain id (reg)\n",
> + node);
>
> - if (id >= pmu->info->num_domains) {
> - dev_err(pmu->dev, "%pOFn: invalid domain id %d\n",
> - node, id);
> - return -EINVAL;
> - }
> + if (id >= pmu->info->num_domains)
> + return dev_err_probe(pmu->dev, -EINVAL,
> + "%pOFn: invalid domain id %d\n", node, id);
These look like code clean-up instead of fixes, thus should be split
into a separate patch, especially when we probably want to backport the
real fixes. This applies for many places below.
Aside these unnecessary code changes, this patch seems in a better shape
than the very first version[1] I submitted a week ago, which seems,
unfortunately, being ignored.
I'll drop the second patch in my series and use yours instead. But
please search before sending patches next time to avoid duplicated work.
--
Thanks,
Yao Zi
Meow-mrrp-mrow, I'm a cat.
[1]: https://lore.kernel.org/linux-rockchip/20261105001257.1368266-1-me@ziyao.cc/
prev parent reply other threads:[~2026-11-12 10:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 8:23 [PATCH v2 0/2] pmdomain: rockchip: fix the probe error and deferral paths Arun Iyengar via B4 Relay
2026-11-12 8:23 ` [PATCH v2 1/2] pmdomain: rockchip: remove subdomain links before the domains on error Arun Iyengar via B4 Relay
2026-11-12 8:23 ` [PATCH v2 2/2] pmdomain: rockchip: report domain errors once, with dev_err_probe() Arun Iyengar via B4 Relay
2026-11-12 10:02 ` Heiko Stübner
2026-11-12 10:52 ` Yao Zi [this message]
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=avWae91pfLv9vyUv@pie \
--to=me@ziyao.cc \
--cc=aiyengar1990@gmail.com \
--cc=heiko@sntech.de \
--cc=igor@armbian.com \
--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=sebastian.reichel@collabora.com \
--cc=shawn.lin@rock-chips.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®