Skip to content
Snippets Groups Projects
Commit 17d42098 authored by Zhipeng Wang's avatar Zhipeng Wang
Browse files

MA-19967 Revert "MA-19337 Revert "PM / Domains: Support enter deepest state...

MA-19967 Revert "MA-19337 Revert "PM / Domains: Support enter deepest state for multiple states domains""

The last time it was reverted, because of structure changes that
blocks gki. To fix [8QM & 8QXP] Power consumption increased in
suspend mode, I plan to use a CONFIG to distinguish 8m* and 8q*.

This reverts commit 0c6748b7.

Change-Id: Ifce0f9d592e96ba691042e45f41ad3392b8a341f
parent 8bc6af2e
No related branches found
No related tags found
No related merge requests found
......@@ -1027,7 +1027,17 @@ static void genpd_sync_power_off(struct generic_pm_domain *genpd, bool use_lock,
{
struct gpd_link *link;
if (!genpd_status_on(genpd) || genpd_is_always_on(genpd))
/*
* Give the power domain a chance to switch to the deepest state in
* case it's already off but in an intermediate low power state.
*/
genpd->state_idx_saved = genpd->state_idx;
if (genpd_is_always_on(genpd))
return;
if (!genpd_status_on(genpd) &&
genpd->state_idx == (genpd->state_count - 1))
return;
if (genpd->suspended_count != genpd->device_count)
......@@ -1038,6 +1048,9 @@ static void genpd_sync_power_off(struct generic_pm_domain *genpd, bool use_lock,
if (_genpd_power_off(genpd, false))
return;
if (genpd->status == GENPD_STATE_OFF)
return;
genpd->status = GENPD_STATE_OFF;
list_for_each_entry(link, &genpd->child_links, child_node) {
......@@ -1084,6 +1097,9 @@ static void genpd_sync_power_on(struct generic_pm_domain *genpd, bool use_lock,
}
_genpd_power_on(genpd, false);
/* restore save power domain state after resume */
genpd->state_idx = genpd->state_idx_saved;
genpd->status = GENPD_STATE_ON;
}
......
......@@ -160,6 +160,7 @@ struct generic_pm_domain {
};
};
unsigned int state_idx_saved; /* saved power state for recovery after system suspend/resume */
};
static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment