[PATCH 2/5] pmdomain: look up pmdomain even if not have_genpd_providers
Ahmad Fatoum
a.fatoum at pengutronix.de
Mon Oct 27 00:19:05 PDT 2025
Hi,
Seems I wrongly squashed the commit message.
On 27.10.25 07:53, Ahmad Fatoum wrote:
have_genpd_providers is a pre-deep-probe artifact, where SoC support
would promise that a power domain driver will be registered.
In a deep probe system, we can just force the probe in __genpd_dev_pm_attach.
Therefore, move the check for have_genpd_providers, until after the
lookup of power domain drivers.
This will be further refined in follow-up commits.
> Signed-off-by: Ahmad Fatoum <a.fatoum at barebox.org>
> ---> drivers/base/power.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/base/power.c b/drivers/base/power.c
> index d60a00f5735e..0cdece210d94 100644
> --- a/drivers/base/power.c
> +++ b/drivers/base/power.c
> @@ -371,9 +371,6 @@ static int __genpd_dev_pm_attach(struct device *dev,
> struct generic_pm_domain *pd;
> int ret;
>
> - if (!have_genpd_providers)
> - return 0;
> -
> ret = of_parse_phandle_with_args(dev->of_node, "power-domains",
> "#power-domain-cells", index, &pd_args);
> if (ret < 0)
> @@ -384,11 +381,18 @@ static int __genpd_dev_pm_attach(struct device *dev,
> ret = PTR_ERR(pd);
> dev_dbg(dev, "%s() failed to find PM domain: %d\n",
> __func__, ret);
> +
> + if (ret == -ENOENT)
> + ret = -EPROBE_DEFER;
> +
> + if (!have_genpd_providers && ret == -EPROBE_DEFER)
> + return 0;
> +
> /*
> * Assume that missing genpds are unresolved
> * dependency are report them as deferred
> */
> - return (ret == -ENOENT) ? -EPROBE_DEFER : ret;
> + return ret;
> }
>
> dev_dbg(dev, "adding to PM domain %s\n", pd ? pd->name : "dummy");
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
More information about the barebox
mailing list