[PATCH v5 09/15] pmdomain: Make genpd_get_from_provider() return -EPROBE_DEFER
Ulf Hansson
ulf.hansson at oss.qualcomm.com
Wed Nov 25 03:08:17 PST 2026
On Wed, Nov 18, 2026 at 8:46 PM Geert Uytterhoeven
<geert+renesas at glider.be> wrote:
>
> 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]; other callsites don't care about the actual error code.
of_genpd_add_subdomain() isn't the only caller of
genpd_get_from_provider(), hence this would change other behaviours
too.
In particular of_genpd_add_child_ids() could suddenly start returning
-EPROBE_DEFER, which seems reasonable to me. My point is, please
extend the commit message so this gets clarified.
Otherwise, the code looks good to me.
Kind regards
Uffe
>
> Fix this for all current and future callers by returning -EPROBE_DEFER
> instead, and drop the no longer needed remapping code.
>
> [1] of_clk_get_hw_from_clkspec(), __fwnode_reset_control_get()),
> [2] Commit 18027d6f392ee8d8 ("PM: domains: Make of_genpd_add_subdomain()
> return -EPROBE_DEFER").
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas at glider.be>
> Tested-by: Wolfram Sang <wsa+renesas at sang-engineering.com>
> ---
> v5:
> - Add Tested-by,
> - Clarify that all other callsites should be fine.
>
> v4:
> - New.
> ---
> drivers/pmdomain/core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c
> index ee8075e90852e738..c242807f62579e5b 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;
> }
> EXPORT_SYMBOL_GPL(of_genpd_add_subdomain);
>
> --
> 2.43.0
>
More information about the linux-arm-kernel
mailing list