PM / Domains: Propagate performance state updates
authorViresh Kumar <viresh.kumar@linaro.org>
Fri, 2 Nov 2018 09:10:19 +0000 (14:40 +0530)
committerViresh Kumar <viresh.kumar@linaro.org>
Fri, 14 Dec 2018 10:58:18 +0000 (16:28 +0530)
commit18edf49c45544cfb93002b3b31fe8fc7fc14d95c
treec1c9a9e3ebd03fb7185540598adc9d80aba197e8
parentcd50c6d3eb91bdff9ac37ee645c49ae274385d35
PM / Domains: Propagate performance state updates

Currently a genpd only handles the performance state requirements from
the devices under its control. This commit extends that to also handle
the performance state requirement(s) put on the master genpd by its
sub-domains. There is a separate value required for each master that
the genpd has and so a new field is added to the struct gpd_link
(link->performance_state), which represents the link between a genpd and
its master. The struct gpd_link also got another field
prev_performance_state, which is used by genpd core as a temporary
variable during transitions.

On a call to dev_pm_genpd_set_performance_state(), the genpd core first
updates the performance state of the masters of the device's genpd and
then updates the performance state of the genpd. The masters do the same
and propagate performance state updates to their masters before updating
their own. The performance state transition from genpd to its master is
done with the help of dev_pm_opp_xlate_performance_state(), which looks
at the OPP tables of both the domains to translate the state.

Tested-by: Rajendra Nayak <rnayak@codeaurora.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/base/power/domain.c
include/linux/pm_domain.h