From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@barebox.org>, barebox@lists.infradead.org
Subject: Re: [PATCH 2/5] pmdomain: look up pmdomain even if not have_genpd_providers
Date: Mon, 27 Oct 2025 08:19:05 +0100 [thread overview]
Message-ID: <a44d6b30-b2dc-4b13-8305-8642fa5e2e9c@pengutronix.de> (raw)
In-Reply-To: <20251027065315.2419160-2-a.fatoum@barebox.org>
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@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 |
next prev parent reply other threads:[~2025-10-27 7:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-27 6:53 [PATCH 1/5] regulator: implement dev_of_regulator_get Ahmad Fatoum
2025-10-27 6:53 ` [PATCH 2/5] pmdomain: look up pmdomain even if not have_genpd_providers Ahmad Fatoum
2025-10-27 7:19 ` Ahmad Fatoum [this message]
2025-10-27 6:53 ` [PATCH 3/5] pmdomain: warn if deep probe enabled and driver missing Ahmad Fatoum
2025-10-27 6:53 ` [PATCH 4/5] pmdomain: allow callback for when devices are attached Ahmad Fatoum
2025-10-27 6:53 ` [PATCH 5/5] pmdomain: add Rockchip power domain support Ahmad Fatoum
2025-10-27 12:27 ` [PATCH 1/5] regulator: implement dev_of_regulator_get Ahmad Fatoum
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=a44d6b30-b2dc-4b13-8305-8642fa5e2e9c@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=a.fatoum@barebox.org \
--cc=barebox@lists.infradead.org \
/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