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 v3 5/6] pmdomain: warn if deep probe enabled and driver missing
Date: Mon,  1 Dec 2025 09:45:55 +0100	[thread overview]
Message-ID: <20251201084737.1270303-5-a.fatoum@barebox.org> (raw)
In-Reply-To: <20251201084737.1270303-1-a.fatoum@barebox.org>

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@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




  parent reply	other threads:[~2025-12-01  8:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-01  8:45 [PATCH v3 1/6] ARM: zynqmp: dts: mark power domain as dummy Ahmad Fatoum
2025-12-01  8:45 ` [PATCH v3 2/6] ARM: rpi: make power domain optional Ahmad Fatoum
2025-12-01  8:45 ` [PATCH v3 3/6] pmdomain: add Rockchip power domain support Ahmad Fatoum
2025-12-01  8:45 ` [PATCH v3 4/6] of: add proper driver for simple-pm-bus Ahmad Fatoum
2025-12-01  8:45 ` Ahmad Fatoum [this message]
2025-12-01  8:45 ` [PATCH v3 6/6] pmdomain: genpd_activate() automatically for deep probe platforms Ahmad Fatoum
2025-12-01 10:49 ` [PATCH v3 1/6] ARM: zynqmp: dts: mark power domain as dummy Sascha Hauer

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=20251201084737.1270303-5-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