]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
power: domain: ti: fix ti_pd_get() to return after verifying transition
authorSiddharth Vadapalli <s-vadapalli@ti.com>
Tue, 18 Nov 2025 12:20:52 +0000 (17:50 +0530)
committerTom Rini <trini@konsulko.com>
Thu, 27 Nov 2025 14:43:51 +0000 (08:43 -0600)
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@ti.com>
Tested-by: Hrushikesh Salunke <h-salunke@ti.com>
drivers/power/domain/ti-power-domain.c

index c35193073400c2b92fe4bd0bed55f6a8d6ea4300..a554e65939235420318f88448d12d21bd3513c81 100644 (file)
@@ -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)