[PATCH v3] power: domain: ti: fix ti_pd_get() to return after verifying transition

Siddharth Vadapalli s-vadapalli at ti.com
Tue Nov 18 13:20:52 CET 2025


The helper function "ti_pd_get()" is responsible for powering on a
domain if it is powered off. In the current implementation, if a power
domain is determined to be powered off - no prior users and the PDCTL
register indicates that the user desired state is OFF, then powering on
the domain constitutes setting 'PDCTL_STATE_ON' field of the PDCTL
register.

While the current implementation indeed requests the power domain to be
transition to the ON state, the helper function "ti_pd_get()" doesn't
verify that the power domain has 'transitioned' to the ON state before
returning to its caller. As a result, it is possible that the device(s)
belonging to the power domain may be accessed before it is truly powered
on, leading to a bus abort.

Fix this by waiting for the power domain to transition to the ON state
by using "ti_pd_wait()" before returning from "ti_pd_get()".

Fixes: 144464bd2c67 ("power: domain: Introduce driver for raw TI K3 PDs")
Signed-off-by: Siddharth Vadapalli <s-vadapalli at ti.com>
---

Hello,

This patch is based on commit
91861e5a30d Merge tag 'u-boot-stm32-20251117' of https://source.denx.de/u-boot/custodians/u-boot-stm
of the master branch of U-Boot.

v2 of this patch is at:
https://lore.kernel.org/r/20251114150243.96429-1-s-vadapalli@ti.com/
Changes since v2:
- Rebased patch on latest master.
- Fixed the parameter passed to ti_pd_wait().

Patch has been tested for PCIe Boot on J784S4 SoC and the 1 millisecond
delay is no longer required in the pcie_cdns_ti_ep.c driver with this
patch.

Regards,
Siddharth.

 drivers/power/domain/ti-power-domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/domain/ti-power-domain.c b/drivers/power/domain/ti-power-domain.c
index c3519307340..a554e659392 100644
--- a/drivers/power/domain/ti-power-domain.c
+++ b/drivers/power/domain/ti-power-domain.c
@@ -227,7 +227,7 @@ static int ti_pd_get(struct ti_pd *pd)
 
 	pd_write(pdctl, pd, PSC_PDCTL);
 
-	return 0;
+	return ti_pd_wait(pd);
 }
 
 static int ti_pd_put(struct ti_pd *pd)
-- 
2.51.1



More information about the U-Boot mailing list