MLK-17074-3 PM / Domains: use default state 0 to enter for multi states domains
authorDong Aisheng <aisheng.dong@nxp.com>
Thu, 30 Nov 2017 09:32:08 +0000 (17:32 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Tue, 20 Mar 2018 19:49:55 +0000 (14:49 -0500)
If no valid state idx specified by governor, we use the default state_idx
0 to enter in case the domain has multi low power states.

Reviewed-by: Frank Li <frank.li@nxp.com>
Reviewed-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
drivers/base/power/domain.c

index 4b885e5..9c3e535 100644 (file)
@@ -319,6 +319,13 @@ static int genpd_poweroff(struct generic_pm_domain *genpd, bool is_async)
        if (genpd->gov && genpd->gov->power_down_ok) {
                if (!genpd->gov->power_down_ok(&genpd->domain))
                        return -EAGAIN;
+       } else {
+               /*
+                * if no valid state idx specified by governor, we use
+                * the default state_idx 0 to enter in case the domain
+                * has multi low power states.
+                */
+               genpd->state_idx = 0;
        }
 
        if (genpd->power_off) {