[PATCH v3 5/6] pmdomain: warn if deep probe enabled and driver missing

Ahmad Fatoum a.fatoum at barebox.org
Mon Dec 1 00:45:55 PST 2025


We shall require any deep probe platforms to have a power domain driver
or make use of barebox,allow-dummy in the device tree.

Otherwise a warning will be printed.

Signed-off-by: Ahmad Fatoum <a.fatoum at barebox.org>
---
v2 -> v3:
  - suggest barebox,allow-dummy instead of dummy drivers
  - print debug message in !have_genpd_providers case
---
 drivers/base/power.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/base/power.c b/drivers/base/power.c
index 6da40a32801c..668b835df3e6 100644
--- a/drivers/base/power.c
+++ b/drivers/base/power.c
@@ -393,8 +393,21 @@ static int __genpd_dev_pm_attach(struct device *dev,
 		if (ret == -ENOENT)
 			ret = -EPROBE_DEFER;
 
-		if (!have_genpd_providers && ret == -EPROBE_DEFER)
-			return 0;
+		if (ret == -EPROBE_DEFER) {
+			/*
+			 * New platforms should either have power domain drivers
+			 * or they should use barebox,allow-dummy, so above
+			 * genpd_get_from_provider() returns NULL.
+			 */
+			if (deep_probe_is_supported()) {
+				dev_warn(dev, "power domain not found (ignoring)\n");
+				return 0;
+			}
+			if (!have_genpd_providers) {
+				dev_dbg(dev, "power domain not found (ignoring)\n");
+				return 0;
+			}
+		}
 
 		/*
 		 * Assume that missing genpds are unresolved
-- 
2.47.3




More information about the barebox mailing list