Skip to contentSkip to conversation

clk: Return value calculated by ERR_PTR

PATCH In review Andrew Goodbody 3 participants 14 messages Nov 21, 2025 – Dec 11, 2025 Common clk

lore
Share & tools
lore
#0 lore raw

v2 cover clk: Return value calculated by ERR_PTR

Smatch reported an error where a value calculated by ERR_PTR was not used. Fixing this to return the generated value led to a test failure which meant updating the sandbox clock code so that it would still cause the tests to pass with the above correction.
Debugging this problem led to a SIGSEGV which is addressed in 1/3. Possible memory leaks noticed are addressed in 3/3.

---
Changes in v2:
- Added 1/3 to prevent SIGSEGV on debug statement
- Added code to original patch now 2/3 to fixup sandbox code that is
needed to keep tests passing with fixed code
- Added 3/3 to prevent memory leaks on error
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Andrew Goodbody (3):
clk: Prevent SIGSEGV on debug
clk: Return value calculated by ERR_PTR
clk: Prevent memory leak on error

 arch/sandbox/include/asm/clk.h |  1 +
 drivers/clk/clk-uclass.c       | 10 +++++-----
 drivers/clk/clk_sandbox.c      | 17 +++++++++++++++++
 test/dm/clk.c                  |  5 +++--
 4 files changed, 26 insertions(+), 7 deletions(-)

---
base-commit: 2bc0715b558fa1ac5c88b11e250740b16a905837
change-id: 20250703-clk_uclass_fix-eaf648b2ebb5

Best regards,

Signature · 1 line
Andrew Goodbody <[email protected]>
#1 lore raw

PATCH v2 1/3 clk: Prevent SIGSEGV on debug

If LOG_DEBUG is defined and a NULL clk is passed to clk_enable or clk_disable then an attempt is made to dereference NULL in the debug statement. Guard against this.

---
 drivers/clk/clk-uclass.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/clk-uclass.c +2 -2
index 3dbe1ce9441ca513d41be90520ff175c96b4253a..1f55dbe385b76d0d6cfbf19bc9f4f1abe619baf2 100644
@@ -660,7 +660,7 @@ int clk_enable(struct clk *clk)
 	struct clk *clkp = NULL;
 	int ret;
 
-	debug("%s(clk=%p name=%s)\n", __func__, clk, clk->dev->name);
+	debug("%s(clk=%p name=%s)\n", __func__, clk, clk ? clk->dev->name : "NULL");
 	if (!clk_valid(clk))
 		return 0;
 	ops = clk_dev_ops(clk->dev);
@@ -721,7 +721,7 @@ int clk_disable(struct clk *clk)
 	struct clk *clkp = NULL;
 	int ret;
 
-	debug("%s(clk=%p name=%s)\n", __func__, clk, clk->dev->name);
+	debug("%s(clk=%p name=%s)\n", __func__, clk, clk ? clk->dev->name : "NULL");
 	if (!clk_valid(clk))
 		return 0;
 	ops = clk_dev_ops(clk->dev);
Signature · 1 line
2.47.3
#2 lore raw

Re: [PATCH v2 1/3] clk: Prevent SIGSEGV on debug

Sorry but I seem to have already sent this patch on its own. I will drop it if the series needs a V2.

Andrew

Quoted 32 lines · Andrew Goodbody

If LOG_DEBUG is defined and a NULL clk is passed to clk_enable or clk_disable then an attempt is made to dereference NULL in the debug statement. Guard against this.

---
  drivers/clk/clk-uclass.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/clk-uclass.c +2 -2
index 3dbe1ce9441ca513d41be90520ff175c96b4253a..1f55dbe385b76d0d6cfbf19bc9f4f1abe619baf2 100644
@@ -660,7 +660,7 @@ int clk_enable(struct clk *clk)
  	struct clk *clkp = NULL;
  	int ret;
 
-	debug("%s(clk=%p name=%s)\n", __func__, clk, clk->dev->name);
+	debug("%s(clk=%p name=%s)\n", __func__, clk, clk ? clk->dev->name : "NULL");
  	if (!clk_valid(clk))
  		return 0;
  	ops = clk_dev_ops(clk->dev);
@@ -721,7 +721,7 @@ int clk_disable(struct clk *clk)
  	struct clk *clkp = NULL;
  	int ret;
 
-	debug("%s(clk=%p name=%s)\n", __func__, clk, clk->dev->name);
+	debug("%s(clk=%p name=%s)\n", __func__, clk, clk ? clk->dev->name : "NULL");
  	if (!clk_valid(clk))
  		return 0;
  	ops = clk_dev_ops(clk->dev);
#3 lore raw

PATCH v2 2/3 clk: Return value calculated by ERR_PTR

In reply to Andrew Goodbody

In clk_set_default_get_by_id ret is passed to ERR_PTR but nothing is done with the value that this calculates which is obviously not the intention of the code. This is confirmed by the code around where this function is called.
Instead return the value from ERR_PTR.

Then fixup the sandbox code so that the test dm_test_clk does not fail as it relied on the broken behaviour.

Finally disable part of the test that does not work correctly with CLK_AUTO_ID

This issue found by Smatch.

---
 arch/sandbox/include/asm/clk.h |  1 +
 drivers/clk/clk-uclass.c       |  4 ++--
 drivers/clk/clk_sandbox.c      | 17 +++++++++++++++++
 test/dm/clk.c                  |  5 +++--
 4 files changed, 23 insertions(+), 4 deletions(-)
arch/sandbox/include/asm/clk.h +1 -0
index 37fe49c7fcf61a0d172dad8539f510431b9ab59d..2d3318cdcc4d5a6710441fcc532dc7d9a06408f0 100644
@@ -50,6 +50,7 @@ enum sandbox_clk_test_id {
 
 struct sandbox_clk_priv {
 	bool probed;
+	struct clk clk;
 	ulong rate[SANDBOX_CLK_ID_COUNT];
 	bool enabled[SANDBOX_CLK_ID_COUNT];
 	bool requested[SANDBOX_CLK_ID_COUNT];
drivers/clk/clk-uclass.c +2 -2
index 1f55dbe385b76d0d6cfbf19bc9f4f1abe619baf2..a72a67d75a165c2d98bb702888e848f6b075fc7d 100644
@@ -199,7 +199,7 @@ static struct clk *clk_set_default_get_by_id(struct clk *clk)
 		if (ret) {
 			debug("%s(): could not get parent clock pointer, id %lu\n",
 			      __func__, clk->id);
-			ERR_PTR(ret);
+			return ERR_PTR(ret);
 		}
 	}
 
@@ -354,7 +354,7 @@ static int clk_set_default_rates(struct udevice *dev,
 
 		c = clk_set_default_get_by_id(&clk);
 		if (IS_ERR(c))
-			return PTR_ERR(c);
+			continue;
 
 		ret = clk_set_rate(c, rates[index]);
 
drivers/clk/clk_sandbox.c +17 -0
index c8c5a88c52d985632733030b0cb92970920a5fc5..cd92a6a29f57565ee140b012e34d284c93247023 100644
@@ -8,8 +8,23 @@
 #include <errno.h>
 #include <malloc.h>
 #include <asm/clk.h>
+#include <dm/device-internal.h>
 #include <linux/clk-provider.h>
 
+static int sandbox_clk_of_to_plat(struct udevice *dev)
+{
+	struct clk *clk;
+	struct sandbox_clk_priv *priv = dev_get_priv(dev);
+
+	clk = &priv->clk;
+
+	/* FIXME: This is not allowed */
+	dev_set_uclass_priv(dev, clk);
+
+	clk->dev = dev;
+	return 0;
+}
+
 static ulong sandbox_clk_get_rate(struct clk *clk)
 {
 	struct sandbox_clk_priv *priv = dev_get_priv(clk->dev);
@@ -102,6 +117,7 @@ static int sandbox_clk_request(struct clk *clk)
 	if (id >= SANDBOX_CLK_ID_COUNT)
 		return -EINVAL;
 
+	priv->clk.id = id;
 	priv->requested[id] = true;
 	return 0;
 }
@@ -132,6 +148,7 @@ U_BOOT_DRIVER(sandbox_clk) = {
 	.name		= "sandbox_clk",
 	.id		= UCLASS_CLK,
 	.of_match	= sandbox_clk_ids,
+	.of_to_plat	= sandbox_clk_of_to_plat,
 	.ops		= &sandbox_clk_ops,
 	.probe		= sandbox_clk_probe,
 	.priv_auto	= sizeof(struct sandbox_clk_priv),
test/dm/clk.c +3 -2
index 790968e64774362d8967845b01b296c528326b99..c3363796498b4db3664a5b3cea10da54161a06fb 100644
@@ -89,8 +89,9 @@ static int dm_test_clk(struct unit_test_state *uts)
 						 SANDBOX_CLK_TEST_ID_SPI));
 	ut_asserteq(0, sandbox_clk_test_get_rate(dev_test,
 						 SANDBOX_CLK_TEST_ID_I2C));
-	ut_asserteq(321, sandbox_clk_test_get_rate(dev_test,
-						   SANDBOX_CLK_TEST_ID_DEVM1));
+	if (!CONFIG_IS_ENABLED(CLK_AUTO_ID))
+		ut_asserteq(321, sandbox_clk_test_get_rate(dev_test,
+							   SANDBOX_CLK_TEST_ID_DEVM1));
 	ut_asserteq(0, sandbox_clk_test_get_rate(dev_test,
 						 SANDBOX_CLK_TEST_ID_DEVM2));
 
Signature · 1 line
2.47.3
#4 lore raw

PATCH v2 3/3 clk: Prevent memory leak on error

In reply to Andrew Goodbody

In clk_set_default_rates() memory is allocated to store the clock rates that are read. Direct returns fail to free this memory leading to a memory leak so instead use 'goto fail;' which will then perform the free before exiting the function.

---
 drivers/clk/clk-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/clk-uclass.c +1 -1
index a72a67d75a165c2d98bb702888e848f6b075fc7d..bf9f104193573918ad2efbce2bd2578948e44811 100644
@@ -338,7 +338,7 @@ static int clk_set_default_rates(struct udevice *dev,
 				continue;
 			}
 
-			return ret;
+			goto fail;
 		}
 
 		/* This is clk provider device trying to program itself
Signature · 1 line
2.47.3
#5 lore raw
In reply to Andrew Goodbody
Quoted 8 lines · Andrew Goodbody

Smatch reported an error where a value calculated by ERR_PTR was not used. Fixing this to return the generated value led to a test failure which meant updating the sandbox clock code so that it would still cause the tests to pass with the above correction.
Debugging this problem led to a SIGSEGV which is addressed in 1/3. Possible memory leaks noticed are addressed in 3/3.

[...]

Applied to u-boot/next, thanks!

[1/3] clk: Prevent SIGSEGV on debug

      commit: 1c0a46e2918a1ddf42f51449e45077513dd52417
[2/3] clk: Return value calculated by ERR_PTR
      commit: fe780310cfa8bf5a093894b5cd7fe85c6b02fd91
[3/3] clk: Prevent memory leak on error
      commit: 33285945518731ed459680ffb01891c4804fb6c9
Signature · 1 line
Tom
#6 lore raw
Quoted 9 lines · Tom Rini
Quoted 7 lines · Andrew Goodbody

Smatch reported an error where a value calculated by ERR_PTR was not used. Fixing this to return the generated value led to a test failure which meant updating the sandbox clock code so that it would still cause the tests to pass with the above correction.
Debugging this problem led to a SIGSEGV which is addressed in 1/3. Possible memory leaks noticed are addressed in 3/3.

Quoted 8 lines
Quoted 1 line

[...]

Applied to u-boot/next, thanks!

[1/3] clk: Prevent SIGSEGV on debug

      commit: 1c0a46e2918a1ddf42f51449e45077513dd52417
[2/3] clk: Return value calculated by ERR_PTR
      commit: fe780310cfa8bf5a093894b5cd7fe85c6b02fd91

This commit seems to have broken TI platforms in next branch.

u-boot$ git bisect log
git bisect start
# status: waiting for both good and bad commits
# bad: [bc1819331ece7aa4e7d0573c9cdacdb8efbdb067] Merge patch series "clk: Return value calculated by ERR_PTR" git bisect bad bc1819331ece7aa4e7d0573c9cdacdb8efbdb067
# status: waiting for good commit(s), bad commit known
# good: [384d3785df4dbe452f9fbb4bd9c9c9e986cdc205] Merge patch series "led: remove unused legacy LED code" git bisect good 384d3785df4dbe452f9fbb4bd9c9c9e986cdc205
# good: [1e8eff6d7a9ad2c605185e5b3d8c22ccd26733dc] board: ti: CAT24C256WI-GT3 require min. 5ms delay (tWR) between write/read git bisect good 1e8eff6d7a9ad2c605185e5b3d8c22ccd26733dc
# good: [1165e8efcba0ab3efd1ea4ff956d26746fc386b0] reboot-mode: Correct macro name from U_BOOT_DEVICE to U_BOOT_DRVINFO git bisect good 1165e8efcba0ab3efd1ea4ff956d26746fc386b0
# bad: [fe780310cfa8bf5a093894b5cd7fe85c6b02fd91] clk: Return value calculated by ERR_PTR
git bisect bad fe780310cfa8bf5a093894b5cd7fe85c6b02fd91
# good: [1c0a46e2918a1ddf42f51449e45077513dd52417] clk: Prevent SIGSEGV on debug
git bisect good 1c0a46e2918a1ddf42f51449e45077513dd52417

# first bad commit: [fe780310cfa8bf5a093894b5cd7fe85c6b02fd91] clk: Return value calculated by ERR_PTR

Confirmed by reverting the commit. Looks like 9ed8fafbcde3425d8817ec5953edd428c7508153 revert is needed again?

Quoted 6 lines

[3/3] clk: Prevent memory leak on error

      commit: 33285945518731ed459680ffb01891c4804fb6c9
Signature · 1 line
Tom
Signature · 4 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
https://ti.com/opensource
#7 lore raw
Quoted 37 lines · Nishanth Menon
Quoted 9 lines · Tom Rini
Quoted 7 lines · Andrew Goodbody

Smatch reported an error where a value calculated by ERR_PTR was not used. Fixing this to return the generated value led to a test failure which meant updating the sandbox clock code so that it would still cause the tests to pass with the above correction.
Debugging this problem led to a SIGSEGV which is addressed in 1/3. Possible memory leaks noticed are addressed in 3/3.

Quoted 8 lines
Quoted 1 line

[...]

Applied to u-boot/next, thanks!

[1/3] clk: Prevent SIGSEGV on debug

      commit: 1c0a46e2918a1ddf42f51449e45077513dd52417
[2/3] clk: Return value calculated by ERR_PTR
      commit: fe780310cfa8bf5a093894b5cd7fe85c6b02fd91

This commit seems to have broken TI platforms in next branch.

u-boot$ git bisect log
git bisect start
# status: waiting for both good and bad commits
# bad: [bc1819331ece7aa4e7d0573c9cdacdb8efbdb067] Merge patch series "clk: Return value calculated by ERR_PTR" git bisect bad bc1819331ece7aa4e7d0573c9cdacdb8efbdb067
# status: waiting for good commit(s), bad commit known
# good: [384d3785df4dbe452f9fbb4bd9c9c9e986cdc205] Merge patch series "led: remove unused legacy LED code" git bisect good 384d3785df4dbe452f9fbb4bd9c9c9e986cdc205
# good: [1e8eff6d7a9ad2c605185e5b3d8c22ccd26733dc] board: ti: CAT24C256WI-GT3 require min. 5ms delay (tWR) between write/read git bisect good 1e8eff6d7a9ad2c605185e5b3d8c22ccd26733dc
# good: [1165e8efcba0ab3efd1ea4ff956d26746fc386b0] reboot-mode: Correct macro name from U_BOOT_DEVICE to U_BOOT_DRVINFO git bisect good 1165e8efcba0ab3efd1ea4ff956d26746fc386b0
# bad: [fe780310cfa8bf5a093894b5cd7fe85c6b02fd91] clk: Return value calculated by ERR_PTR
git bisect bad fe780310cfa8bf5a093894b5cd7fe85c6b02fd91
# good: [1c0a46e2918a1ddf42f51449e45077513dd52417] clk: Prevent SIGSEGV on debug
git bisect good 1c0a46e2918a1ddf42f51449e45077513dd52417

Quoted 4 lines
# first bad commit: [fe780310cfa8bf5a093894b5cd7fe85c6b02fd91] clk: Return value calculated by ERR_PTR

Confirmed by reverting the commit. Looks like 9ed8fafbcde3425d8817ec5953edd428c7508153 revert is needed again?

Interesting, OK. What Andrew did in commit fe780310cfa8bf5a093894b5cd7fe85c6b02fd91 is more complex than before and there's two stanzas there. Our lab is current being re-worked again right now so I can't test on the K3 platforms I have, but can you please see which of the two changes in clk-uclass.c is the one that breaks these platforms? Thanks!

Signature · 1 line
Tom
#8 lore raw
Quoted 43 lines · Tom Rini
Quoted 37 lines · Nishanth Menon
Quoted 9 lines · Tom Rini
Quoted 7 lines · Andrew Goodbody

Smatch reported an error where a value calculated by ERR_PTR was not used. Fixing this to return the generated value led to a test failure which meant updating the sandbox clock code so that it would still cause the tests to pass with the above correction.
Debugging this problem led to a SIGSEGV which is addressed in 1/3. Possible memory leaks noticed are addressed in 3/3.

Quoted 8 lines
Quoted 1 line

[...]

Applied to u-boot/next, thanks!

[1/3] clk: Prevent SIGSEGV on debug

       commit: 1c0a46e2918a1ddf42f51449e45077513dd52417
[2/3] clk: Return value calculated by ERR_PTR
       commit: fe780310cfa8bf5a093894b5cd7fe85c6b02fd91

This commit seems to have broken TI platforms in next branch.

u-boot$ git bisect log
git bisect start
# status: waiting for both good and bad commits
# bad: [bc1819331ece7aa4e7d0573c9cdacdb8efbdb067] Merge patch series "clk: Return value calculated by ERR_PTR" git bisect bad bc1819331ece7aa4e7d0573c9cdacdb8efbdb067
# status: waiting for good commit(s), bad commit known
# good: [384d3785df4dbe452f9fbb4bd9c9c9e986cdc205] Merge patch series "led: remove unused legacy LED code" git bisect good 384d3785df4dbe452f9fbb4bd9c9c9e986cdc205
# good: [1e8eff6d7a9ad2c605185e5b3d8c22ccd26733dc] board: ti: CAT24C256WI-GT3 require min. 5ms delay (tWR) between write/read git bisect good 1e8eff6d7a9ad2c605185e5b3d8c22ccd26733dc
# good: [1165e8efcba0ab3efd1ea4ff956d26746fc386b0] reboot-mode: Correct macro name from U_BOOT_DEVICE to U_BOOT_DRVINFO git bisect good 1165e8efcba0ab3efd1ea4ff956d26746fc386b0
# bad: [fe780310cfa8bf5a093894b5cd7fe85c6b02fd91] clk: Return value calculated by ERR_PTR
git bisect bad fe780310cfa8bf5a093894b5cd7fe85c6b02fd91
# good: [1c0a46e2918a1ddf42f51449e45077513dd52417] clk: Prevent SIGSEGV on debug
git bisect good 1c0a46e2918a1ddf42f51449e45077513dd52417

Quoted 4 lines
# first bad commit: [fe780310cfa8bf5a093894b5cd7fe85c6b02fd91] clk: Return value calculated by ERR_PTR

Confirmed by reverting the commit. Looks like 9ed8fafbcde3425d8817ec5953edd428c7508153 revert is needed again?

Quoted 6 lines

Interesting, OK. What Andrew did in commit fe780310cfa8bf5a093894b5cd7fe85c6b02fd91 is more complex than before and there's two stanzas there. Our lab is current being re-worked again right now so I can't test on the K3 platforms I have, but can you please see which of the two changes in clk-uclass.c is the one that breaks these platforms? Thanks!

What is the breakage please? I did put this series through CI and the only issues were due to lack of disk space, so not related to the patches.

Andrew

#9 lore raw
Quoted 52 lines · Andrew Goodbody
Quoted 43 lines · Tom Rini
Quoted 37 lines · Nishanth Menon
Quoted 9 lines · Tom Rini
Quoted 7 lines · Andrew Goodbody

Smatch reported an error where a value calculated by ERR_PTR was not used. Fixing this to return the generated value led to a test failure which meant updating the sandbox clock code so that it would still cause the tests to pass with the above correction.
Debugging this problem led to a SIGSEGV which is addressed in 1/3. Possible memory leaks noticed are addressed in 3/3.

Quoted 8 lines
Quoted 1 line

[...]

Applied to u-boot/next, thanks!

[1/3] clk: Prevent SIGSEGV on debug

       commit: 1c0a46e2918a1ddf42f51449e45077513dd52417
[2/3] clk: Return value calculated by ERR_PTR
       commit: fe780310cfa8bf5a093894b5cd7fe85c6b02fd91

This commit seems to have broken TI platforms in next branch.

u-boot$ git bisect log
git bisect start
# status: waiting for both good and bad commits
# bad: [bc1819331ece7aa4e7d0573c9cdacdb8efbdb067] Merge patch series "clk: Return value calculated by ERR_PTR" git bisect bad bc1819331ece7aa4e7d0573c9cdacdb8efbdb067
# status: waiting for good commit(s), bad commit known
# good: [384d3785df4dbe452f9fbb4bd9c9c9e986cdc205] Merge patch series "led: remove unused legacy LED code" git bisect good 384d3785df4dbe452f9fbb4bd9c9c9e986cdc205
# good: [1e8eff6d7a9ad2c605185e5b3d8c22ccd26733dc] board: ti: CAT24C256WI-GT3 require min. 5ms delay (tWR) between write/read git bisect good 1e8eff6d7a9ad2c605185e5b3d8c22ccd26733dc
# good: [1165e8efcba0ab3efd1ea4ff956d26746fc386b0] reboot-mode: Correct macro name from U_BOOT_DEVICE to U_BOOT_DRVINFO git bisect good 1165e8efcba0ab3efd1ea4ff956d26746fc386b0
# bad: [fe780310cfa8bf5a093894b5cd7fe85c6b02fd91] clk: Return value calculated by ERR_PTR
git bisect bad fe780310cfa8bf5a093894b5cd7fe85c6b02fd91
# good: [1c0a46e2918a1ddf42f51449e45077513dd52417] clk: Prevent SIGSEGV on debug
git bisect good 1c0a46e2918a1ddf42f51449e45077513dd52417

Quoted 4 lines
# first bad commit: [fe780310cfa8bf5a093894b5cd7fe85c6b02fd91] clk: Return value calculated by ERR_PTR

Confirmed by reverting the commit. Looks like 9ed8fafbcde3425d8817ec5953edd428c7508153 revert is needed again?

Quoted 6 lines

Interesting, OK. What Andrew did in commit fe780310cfa8bf5a093894b5cd7fe85c6b02fd91 is more complex than before and there's two stanzas there. Our lab is current being re-worked again right now so I can't test on the K3 platforms I have, but can you please see which of the two changes in clk-uclass.c is the one that breaks these platforms? Thanks!

Quoted 5 lines

What is the breakage please? I did put this series through CI and the only issues were due to lack of disk space, so not related to the patches.

Andrew

Looks like A72 would'nt get started.. adding a bit of print to get an idea:

https://gist.github.com/nmenon/c0487b99cbd2308ccd11ffe510a780bb

Signature · 4 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
https://ti.com/opensource
#10 lore raw
Quoted 1 line · Nishanth Menon

On 15:52-20251208, Andrew Goodbody wrote:

[..]

Quoted 12 lines
Quoted 12 lines
Quoted 9 lines
Quoted 2 lines

Confirmed by reverting the commit. Looks like 9ed8fafbcde3425d8817ec5953edd428c7508153 revert is needed again?

Interesting, OK. What Andrew did in commit fe780310cfa8bf5a093894b5cd7fe85c6b02fd91 is more complex than before and there's two stanzas there. Our lab is current being re-worked again right now so I can't test on the K3 platforms I have, but can you please see which of the two changes in clk-uclass.c is the one that breaks these platforms? Thanks!

What is the breakage please? I did put this series through CI and the only issues were due to lack of disk space, so not related to the patches.

Quoted 7 lines
Quoted 2 lines

Andrew

Looks like A72 would'nt get started.. adding a bit of print to get an idea:

https://gist.github.com/nmenon/c0487b99cbd2308ccd11ffe510a780bb

Any suggestions to proceed?

Signature · 4 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
https://ti.com/opensource
#11 lore raw
Quoted 18 lines · Nishanth Menon
Quoted 1 line · Nishanth Menon

On 15:52-20251208, Andrew Goodbody wrote:

[..]

Quoted 14 lines
Quoted 14 lines
Quoted 9 lines
Quoted 2 lines

Confirmed by reverting the commit. Looks like 9ed8fafbcde3425d8817ec5953edd428c7508153 revert is needed again?

Interesting, OK. What Andrew did in commit fe780310cfa8bf5a093894b5cd7fe85c6b02fd91 is more complex than before and there's two stanzas there. Our lab is current being re-worked again right now so I can't test on the K3 platforms I have, but can you please see which of the two changes in clk-uclass.c is the one that breaks these platforms? Thanks!

What is the breakage please? I did put this series through CI and the only issues were due to lack of disk space, so not related to the patches.

Andrew

Quoted 8 lines
Quoted 5 lines

Looks like A72 would'nt get started.. adding a bit of print to get an idea:

https://gist.github.com/nmenon/c0487b99cbd2308ccd11ffe510a780bb

Any suggestions to proceed?

Can you please see which of the two changes to clk-uclass.c is the one at fault, or if it's both? Thanks!

Signature · 1 line
Tom
#12 lore raw
Quoted 22 lines · Tom Rini
Quoted 21 lines · Nishanth Menon
Quoted 1 line · Nishanth Menon

On 15:52-20251208, Andrew Goodbody wrote:

[..]

Quoted 17 lines
Quoted 9 lines
Quoted 9 lines
Quoted 2 lines

Confirmed by reverting the commit. Looks like 9ed8fafbcde3425d8817ec5953edd428c7508153 revert is needed again?

Interesting, OK. What Andrew did in commit fe780310cfa8bf5a093894b5cd7fe85c6b02fd91 is more complex than before and there's two stanzas there. Our lab is current being re-worked again right now so I can't test on the K3 platforms I have, but can you please see which of the two changes in clk-uclass.c is the one that breaks these platforms? Thanks!

Quoted 5 lines

What is the breakage please? I did put this series through CI and the only issues were due to lack of disk space, so not related to the patches.

Andrew

Looks like A72 would'nt get started.. adding a bit of print to get an idea:

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

https://gist.github.com/nmenon/c0487b99cbd2308ccd11ffe510a780bb

Any suggestions to proceed?

Can you please see which of the two changes to clk-uclass.c is the one at fault, or if it's both? Thanks!

The logs show the details
https://gist.github.com/nmenon/c0487b99cbd2308ccd11ffe510a780bb#file-log-patch-L12
(return ERR_PTR) triggers the flow in https://gist.github.com/nmenon/c0487b99cbd2308ccd11ffe510a780bb#file-log-patch-L19
and fails

This looks like the clock for A72 that needs to be set from R5 SPL to start up A72 - with the fail, A72 does'nt start up.

Signature · 4 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
https://ti.com/opensource
#13 lore raw
Quoted 33 lines · Nishanth Menon
Quoted 22 lines · Tom Rini
Quoted 21 lines · Nishanth Menon
Quoted 1 line · Nishanth Menon

On 15:52-20251208, Andrew Goodbody wrote:

[..]

Quoted 17 lines
Quoted 9 lines
Quoted 9 lines
Quoted 2 lines

Confirmed by reverting the commit. Looks like 9ed8fafbcde3425d8817ec5953edd428c7508153 revert is needed again?

Interesting, OK. What Andrew did in commit fe780310cfa8bf5a093894b5cd7fe85c6b02fd91 is more complex than before and there's two stanzas there. Our lab is current being re-worked again right now so I can't test on the K3 platforms I have, but can you please see which of the two changes in clk-uclass.c is the one that breaks these platforms? Thanks!

Quoted 5 lines

What is the breakage please? I did put this series through CI and the only issues were due to lack of disk space, so not related to the patches.

Andrew

Looks like A72 would'nt get started.. adding a bit of print to get an idea:

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

https://gist.github.com/nmenon/c0487b99cbd2308ccd11ffe510a780bb

Any suggestions to proceed?

Can you please see which of the two changes to clk-uclass.c is the one at fault, or if it's both? Thanks!

Quoted 7 lines

The logs show the details
https://gist.github.com/nmenon/c0487b99cbd2308ccd11ffe510a780bb#file-log-patch-L12
(return ERR_PTR) triggers the flow in https://gist.github.com/nmenon/c0487b99cbd2308ccd11ffe510a780bb#file-log-patch-L19
and fails

This looks like the clock for A72 that needs to be set from R5 SPL to start up A72 - with the fail, A72 does'nt start up.

Thanks. Andrew, I think instead of return ERR_PTR(ret) we should just drop the line there and keep just a debug print. Which also means that a bunch of this code seems to be written oddly, given the required behavior.

Signature · 1 line
Tom