2015-11-10 11:02:34

by Axel Haslam

[permalink] [raw]
Subject: Re: [PATCH v10 2/6] PM / Domains: core changes for multiple states

Hi Zhaoyang,

> @@ -576,6 +584,8 @@ static void pm_genpd_sync_poweroff(struct
> generic_pm_domain *genpd,
> || atomic_read(&genpd->sd_count) > 0)
> return;
>
> + /* Choose the deepest state when suspending */
> + genpd->state_idx = genpd->state_count - 1;
>
> if there is no governor configured, does it mean that we just try the
> deepest one here?
>

If a governor is not configured, there is no way to choose between the
states, and the state_idx will not change. so it will remain the one set
at the genpd init function wich is the same as here: the deepest state.
(state_count -1). In other words, if there is no governor, there
is only one state: the deepest.

About setting the deepest state in this particular place, My
understanding is that this code will be called in suspend path,
and in this case genpd_poweroff is not called, hence the genpd governor
is not called either. Because there are many other things happening
during suspend/resume, i think that suspend/resume is a slow procedure
that will most likely not honor the device qos constraints, so i set the
genpd to its deepest state.

Regards
Axel
> genpd_power_off(genpd, timed);
>
> genpd->status = GPD_STATE_POWER_OFF;