mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@barebox.org>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@barebox.org>
Subject: [PATCH v2 2/5] pmdomain: look up pmdomain even if not have_genpd_providers
Date: Mon, 27 Oct 2025 20:28:17 +0100	[thread overview]
Message-ID: <20251027192938.2586566-2-a.fatoum@barebox.org> (raw)
In-Reply-To: <20251027192938.2586566-1-a.fatoum@barebox.org>

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>
---
v1 -> v2:
  - add missing commit messages
---
 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");
-- 
2.47.3




  reply	other threads:[~2025-10-27 19:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-27 19:28 [PATCH v2 1/5] regulator: implement dev_of_regulator_get Ahmad Fatoum
2025-10-27 19:28 ` Ahmad Fatoum [this message]
2025-10-27 19:28 ` [PATCH v2 3/5] pmdomain: warn if deep probe enabled and driver missing Ahmad Fatoum
2025-10-27 19:28 ` [PATCH v2 4/5] pmdomain: allow callback for when devices are attached Ahmad Fatoum
2025-10-27 19:28 ` [PATCH v2 5/5] pmdomain: add Rockchip power domain support Ahmad Fatoum
2025-10-28  8:57   ` Sascha Hauer
2025-10-28  9:04     ` Ahmad Fatoum
2025-10-28  9:48       ` Sascha Hauer
2025-10-28 10:41         ` Ahmad Fatoum
2025-10-28 10:46           ` Sascha Hauer
2025-10-28 11:01             ` 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=20251027192938.2586566-2-a.fatoum@barebox.org \
    --to=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