[PATCH v3 12/13] pmdomain: core: Avoid an unnecessary power off at sync_state
Ulf Hansson
ulf.hansson at linaro.org
Fri May 8 05:39:01 PDT 2026
If the PM domain was not powered on during initialization, genpd will not
prevent it from being powered off during boot. In these cases there is no
need to call genpd_power_off() at sync_state, hence let's avoid it.
Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
---
Changes in v3:
- New patch.
---
drivers/pmdomain/core.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c
index b3ec3dec3f10..b5d90ddfd698 100644
--- a/drivers/pmdomain/core.c
+++ b/drivers/pmdomain/core.c
@@ -3636,8 +3636,10 @@ void of_genpd_sync_state(struct device_node *np)
list_for_each_entry(genpd, &gpd_list, gpd_list_node) {
if (genpd->provider == of_fwnode_handle(np)) {
genpd_lock(genpd);
- genpd->stay_on = false;
- genpd_power_off(genpd, false, 0);
+ if (genpd->stay_on) {
+ genpd->stay_on = false;
+ genpd_power_off(genpd, false, 0);
+ }
genpd_unlock(genpd);
}
}
@@ -3674,8 +3676,10 @@ static void genpd_provider_sync_state(struct device *dev)
case GENPD_SYNC_STATE_SIMPLE:
genpd_lock(genpd);
- genpd->stay_on = false;
- genpd_power_off(genpd, false, 0);
+ if (genpd->stay_on) {
+ genpd->stay_on = false;
+ genpd_power_off(genpd, false, 0);
+ }
genpd_unlock(genpd);
break;
--
2.43.0
More information about the linux-arm-kernel
mailing list