From: sashiko-bot@kernel.org
To: "Geert Uytterhoeven" <geert+renesas@glider.be>
Cc: devicetree@vger.kernel.org, linux-clk@vger.kernel.org,
robh@kernel.org, conor+dt@kernel.org,
wsa+renesas@sang-engineering.com
Subject: Re: [PATCH v4 5/8] pmdomain: Make genpd_get_from_provider() return -EPROBE_DEFER
Date: Fri, 16 Oct 2026 16:09:49 +0000 [thread overview]
Message-ID: <sashiko-outbox-174605@kernel.org> (raw)
In-Reply-To: <4524363679c1f2163aca3b3dda2bfbde170d095a.1792163045.git.geert+renesas@glider.be>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] pmdomain: unnecessary probe deferral on invalid domain index
--
commit c105920d803c0cf9396fb90d8428fdc4d83e8655
Author: Geert Uytterhoeven <geert+renesas@glider.be>
pmdomain: Make genpd_get_from_provider() return -EPROBE_DEFER
Unlike provider-based look-up functions in other subsystems[1],
genpd_get_from_provider() returns -ENOENT instead of -EPROBE_DEFER when
the provider is not found, thus not supporting probe deferral.
Currently this is worked around in of_genpd_add_subdomain() by remapping
-ENOENT[2].
Fix this for all current and future callers by returning -EPROBE_DEFER
instead, and drop the no longer needed remapping code.
> diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c
> index 964e44c2f78f1..88c886814a5b9 100644
> --- a/drivers/pmdomain/core.c
> +++ b/drivers/pmdomain/core.c
> @@ -3021,7 +3021,7 @@ EXPORT_SYMBOL_GPL(of_genpd_del_provider);
> static struct generic_pm_domain *genpd_get_from_provider(
> const struct of_phandle_args *genpdspec)
> {
> - struct generic_pm_domain *genpd = ERR_PTR(-ENOENT);
> + struct generic_pm_domain *genpd = ERR_PTR(-EPROBE_DEFER);
> struct of_genpd_provider *provider;
>
> if (!genpdspec)
[ ... ]
> @@ -3276,7 +3276,7 @@ int of_genpd_add_subdomain(const struct of_phandle_args *parent_spec,
> out:
> mutex_unlock(&gpd_list_lock);
>
> - return ret == -ENOENT ? -EPROBE_DEFER : ret;
> + return ret;
> }
[Severity: Low]
Does this change leave an unnecessary probe deferral in __genpd_dev_pm_attach()?
If a device specifies a valid PM domain provider but an invalid domain index,
genpd_get_from_provider() returns the specific error code from the provider's
xlate callback, such as -ENOENT.
However, __genpd_dev_pm_attach() still unconditionally routes all errors
through driver_deferred_probe_check_state():
drivers/pmdomain/core.c:__genpd_dev_pm_attach() {
...
pd = genpd_get_from_provider(&pd_args);
of_node_put(pd_args.np);
if (IS_ERR(pd)) {
mutex_unlock(&gpd_list_lock);
dev_dbg(dev, "%s() failed to find PM domain: %ld\n",
__func__, PTR_ERR(pd));
return driver_deferred_probe_check_state(base_dev);
}
...
}
Could this unnecessarily delay boot and error reporting for devices with
permanently invalid PM domain IDs by forcing a wait until late_initcall?
Should __genpd_dev_pm_attach() be updated to only call
driver_deferred_probe_check_state() when PTR_ERR(pd) is -EPROBE_DEFER?
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1792163045.git.geert+renesas@glider.be?part=5
next prev parent reply other threads:[~2026-10-16 16:09 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 15:55 [PATCH v4 0/8] R-Car X5H Ironhide CPG/MDLC SCMI remapping support Geert Uytterhoeven
2026-10-16 15:55 ` [PATCH v4 1/8] clk: renesas: r8a78000: Add clk_hw to clk_map Geert Uytterhoeven
2026-10-16 15:55 ` [PATCH v4 2/8] clk: renesas: r8a78000: Add SCMI remapping support Geert Uytterhoeven
2026-10-16 16:13 ` sashiko-bot
2026-10-16 16:17 ` Geert Uytterhoeven
2026-10-16 15:55 ` [PATCH v4 3/8] reset: Extract __reset_control_get_from_provider() Geert Uytterhoeven
2026-10-16 15:55 ` [PATCH v4 4/8] reset: Add reset_control_get_from_provider_exclusive() Geert Uytterhoeven
2026-10-16 16:02 ` sashiko-bot
2026-10-16 16:08 ` Geert Uytterhoeven
2026-10-16 15:55 ` [PATCH v4 5/8] pmdomain: Make genpd_get_from_provider() return -EPROBE_DEFER Geert Uytterhoeven
2026-10-16 16:09 ` sashiko-bot [this message]
2026-10-16 15:55 ` [PATCH v4 6/8] pmdomain: Make genpd_get_from_provider() public Geert Uytterhoeven
2026-10-16 16:08 ` sashiko-bot
2026-10-16 15:55 ` [PATCH v4 7/8] pmdomain: renesas: r8a78000: Add SCMI remapping support Geert Uytterhoeven
2026-10-16 16:15 ` sashiko-bot
2026-10-16 15:55 ` [PATCH v4 8/8] arm64: dts: renesas: ironhide: Enable SCMI devpd, sys, clock, and reset Geert Uytterhoeven
2026-10-17 11:17 ` [PATCH v4 0/8] R-Car X5H Ironhide CPG/MDLC SCMI remapping support Wolfram Sang
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=sashiko-outbox-174605@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=geert+renesas@glider.be \
--cc=linux-clk@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=wsa+renesas@sang-engineering.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