U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Francesco Dolcini <francesco@dolcini.it>
Cc: Neha Malcom Francis <n-francis@ti.com>,
	 Tom Rini <trini@konsulko.com>, Nishanth Menon <nm@ti.com>,
	 Simon Glass <sjg@chromium.org>,
	 Jaehoon Chung <jh80.chung@samsung.com>,
	 Lukasz Majewski <lukma@denx.de>,
	 Sean Anderson <seanga2@gmail.com>,
	 Anatolij Gustschin <agust@denx.de>,
	 Fabio Estevm <festevam@gmail.com>,  Peng Fan <peng.fan@nxp.com>,
	 Mario Six <mario.six@gdsys.cc>,
	 Svyatoslav Ryhel <clamor95@gmail.com>,
	 Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	 u-boot@lists.denx.de,  Ian Ray <ian.ray@gehealthcare.com>,
	 Michael Nazzareno Trimarchi <michael@amarulasolutions.com>,
	 Dario Binacchi <dario.binacchi@amarulasolutions.com>,
	 Adam Ford <aford173@gmail.com>, Marek Vasut <marex@denx.de>,
	 Udit Kumar <u-kumar1@ti.com>
Subject: Re: [PATCH v6 05/12] power-domain: Add refcounting
Date: Tue, 15 Apr 2025 10:15:00 +0200	[thread overview]
Message-ID: <87wmblyh6j.fsf@bootlin.com> (raw)
In-Reply-To: <20250415065115.GA10924@francesco-nb> (Francesco Dolcini's message of "Tue, 15 Apr 2025 08:51:15 +0200")

[-- Attachment #1: Type: text/plain, Size: 1523 bytes --]

Hello,

Thanks for the report.

>> >>> Neha bisected it down to 197376fbf300e92afa0a1583815d9c9eb52d613a commit
>> >>> which is this patch.
>> >>
>> >> And assuming it's the same failure I got reported this morning by one of
>> >> my coworkers, we just get:
>> >> U-Boot SPL 2025.04-01050-ga40fc5afaec0 (Apr 14 2025 - 07:31:32 +0000)
>> >> SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.7--v09.02.07 (Kool Koala)')
>> 
>> This is not the failure I am seeing, we hang before console comes up so
>> no prints. Looks like the different failure signature is due to TIFS
>> (SYSFW) firmware being different (v9.2.7 vs. 11.0.4)
>
> To me it was failing freezing just after this
>
> U-Boot SPL 2025.04-01076-g739ad58dbee8 (Apr 14 2025 - 17:23:46 +0200)
> SYSFW ABI: 4.0 (firmware rev 0x000b '11.0.7--v11.00.07 (Fancy Rat)')
>
> and, with commit 197376fbf300 ("power-domain: Add refcounting") reverted
> the issue is fixed and I get to the U-Boot command line.

Francesco, are you also testing on K3 platforms?

Can one of you boot with the patch below applied? It should partially
revert the commit to the ancient behaviour, while adding more debug
traces (please enable the debug logs as well). This should clarify
which one of the 3 different path is likely failing. It should also help
identify who's the user that fails to enable/disable its own power
domain. I will need to know what board/SoC was used for the test, so I
can look the relevant driver up.

Thanks for your help,
Miquèl

---


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-HACK-power-domain-Add-debug-traces-without-actually-.patch --]
[-- Type: text/x-patch, Size: 1915 bytes --]

From 4b128872b2dbcdfb626b8683fbb6c75d17a5089c Mon Sep 17 00:00:00 2001
From: Miquel Raynal <miquel.raynal@bootlin.com>
Date: Tue, 15 Apr 2025 10:07:05 +0200
Subject: [PATCH] HACK: power-domain: Add debug traces without actually failing

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/power/domain/power-domain-uclass.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/power/domain/power-domain-uclass.c b/drivers/power/domain/power-domain-uclass.c
index a6e5f9ed0369..18ace2cc7256 100644
--- a/drivers/power/domain/power-domain-uclass.c
+++ b/drivers/power/domain/power-domain-uclass.c
@@ -117,10 +117,12 @@ int power_domain_on_lowlevel(struct power_domain *power_domain)
 	struct power_domain_ops *ops = power_domain_dev_ops(power_domain->dev);
 	int ret;
 
-	debug("%s(power_domain=%p)\n", __func__, power_domain);
+	debug("%s(power_domain=%p, id %d)\n", __func__, power_domain, power_domain->id);
 
-	if (priv->on_count++ > 0)
-		return -EALREADY;
+	if (priv->on_count++ > 0) {
+		debug("Power domain %s already on.\n", power_domain->dev->name);
+		//return -EALREADY;
+	}
 
 	ret = ops->on ? ops->on(power_domain) : 0;
 	if (ret) {
@@ -137,15 +139,17 @@ int power_domain_off_lowlevel(struct power_domain *power_domain)
 	struct power_domain_ops *ops = power_domain_dev_ops(power_domain->dev);
 	int ret;
 
-	debug("%s(power_domain=%p)\n", __func__, power_domain);
+	debug("%s(power_domain=%p, id %d)\n", __func__, power_domain, power_domain->id);
 
 	if (priv->on_count <= 0) {
 		debug("Power domain %s already off.\n", power_domain->dev->name);
-		return -EALREADY;
+		//return -EALREADY;
 	}
 
-	if (priv->on_count-- > 1)
-		return -EBUSY;
+	if (priv->on_count-- > 1) {
+		debug("Power domain %s still in use.\n", power_domain->dev->name);
+		//return -EBUSY;
+	}
 
 	ret = ops->off ? ops->off(power_domain) : 0;
 	if (ret) {
-- 
2.48.1


  reply	other threads:[~2025-04-15 12:50 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-03  7:39 [PATCH v6 00/12] Add imx8mp video support Miquel Raynal
2025-04-03  7:39 ` [PATCH v6 01/12] core: ofnode_graph: Fix a comment Miquel Raynal
2025-04-03  7:39 ` [PATCH v6 02/12] dm: doc: Fix example Miquel Raynal
2025-04-03  7:39 ` [PATCH v6 03/12] dm: core: Add a helper to retrieve devices through graph endpoints Miquel Raynal
2025-04-03  8:08   ` Miquel Raynal
2025-04-03  7:39 ` [PATCH v6 04/12] test: dm: test-fdt: Add checks for uclass_get_device_by_endpoint() Miquel Raynal
2025-04-03  7:39 ` [PATCH v6 05/12] power-domain: Add refcounting Miquel Raynal
2025-04-14 17:36   ` Francis, Neha
2025-04-14 18:07     ` Nishanth Menon
2025-04-14 20:06       ` Tom Rini
2025-04-14 21:00         ` Francesco Dolcini
2025-04-15  5:20           ` Neha Malcom Francis
2025-04-15  6:51             ` Francesco Dolcini
2025-04-15  8:15               ` Miquel Raynal [this message]
2025-04-15  8:59                 ` Neha Malcom Francis
2025-04-15  9:50                   ` Miquel Raynal
2025-04-15  9:59                     ` Neha Malcom Francis
2025-04-15 10:47                       ` Francesco Dolcini
2025-04-15 12:43                       ` Miquel Raynal
2025-04-16  7:46                         ` Neha Malcom Francis
2025-04-16  1:14   ` Samuel Holland
2025-04-16  8:36     ` Neha Malcom Francis
2025-04-16  9:06       ` Miquel Raynal
2025-04-16  9:50         ` Neha Malcom Francis
2025-04-16 13:20           ` Wadim Egorov
2025-04-16 15:49             ` Miquel Raynal
2025-04-03  7:39 ` [PATCH v6 06/12] clk: Ensure the parent clocks are enabled while reparenting Miquel Raynal
2025-04-03 13:03   ` Adam Ford
2025-04-03  7:39 ` [PATCH v6 07/12] clk: imx8mp: Add media related clocks Miquel Raynal
2025-04-03  7:39 ` [PATCH v6 08/12] imx: power-domain: Describe the i.MX8 MEDIAMIX domain Miquel Raynal
2025-04-03  7:39 ` [PATCH v6 09/12] imx: power-domain: Add support for the MEDIAMIX control block Miquel Raynal
2025-04-03 12:57   ` Adam Ford
2025-04-04  6:30     ` Miquel Raynal
2025-04-03  7:39 ` [PATCH v6 10/12] video: imx: Fix Makefile in order to be able to add other imx drivers Miquel Raynal
2025-04-03  7:39 ` [PATCH v6 11/12] video: imx: Add LDB driver Miquel Raynal
2025-04-03  7:39 ` [PATCH v6 12/12] video: imx: Add LCDIF driver Miquel Raynal
2025-04-03 13:01   ` Adam Ford
2025-04-04  6:22     ` Miquel Raynal
2025-04-11 14:15 ` [PATCH v6 00/12] Add imx8mp video support Fabio Estevam

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=87wmblyh6j.fsf@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=aford173@gmail.com \
    --cc=agust@denx.de \
    --cc=clamor95@gmail.com \
    --cc=dario.binacchi@amarulasolutions.com \
    --cc=festevam@gmail.com \
    --cc=francesco@dolcini.it \
    --cc=ian.ray@gehealthcare.com \
    --cc=jh80.chung@samsung.com \
    --cc=lukma@denx.de \
    --cc=marex@denx.de \
    --cc=mario.six@gdsys.cc \
    --cc=michael@amarulasolutions.com \
    --cc=n-francis@ti.com \
    --cc=nm@ti.com \
    --cc=peng.fan@nxp.com \
    --cc=seanga2@gmail.com \
    --cc=sjg@chromium.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=u-kumar1@ti.com \
    /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