1
0
Fork 0

PM / Domains: Choose the deepest state to enter if no devices using it

For a domain has no working devices anymore, let's choose the deepest state
to enter to save power. e.g. driver probe failure.

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Dong Aisheng 2019-03-05 20:28:00 +08:00
parent f93257d4e4
commit 85dd28204d
1 changed files with 4 additions and 0 deletions

View File

@ -548,6 +548,10 @@ static int genpd_power_off(struct generic_pm_domain *genpd, bool one_dev_on,
if (!genpd->gov)
genpd->state_idx = 0;
/* Choose the deepest state if no devices using this domain */
if (!genpd->device_count)
genpd->state_idx = genpd->state_count - 1;
/*
* If sd_count > 0 at this point, one of the subdomains hasn't
* managed to call genpd_power_on() for the master yet after