summaryrefslogtreecommitdiff
path: root/drivers/cpuidle/cpuidle-psci.c
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2019-10-10 13:01:48 +0300
committerUlf Hansson <ulf.hansson@linaro.org>2020-01-02 18:52:57 +0300
commita65a397f245137f6ffcd5e6490cd2504c30f8e73 (patch)
treecba8a81c798ec4ff418af95db39b77fe61fe5ecf /drivers/cpuidle/cpuidle-psci.c
parentdedd14925ec6f82a2840c009bc175e2b528ace8e (diff)
downloadlinux-a65a397f245137f6ffcd5e6490cd2504c30f8e73.tar.xz
cpuidle: psci: Add support for PM domains by using genpd
When the hierarchical CPU topology layout is used in DT and the PSCI OSI mode is supported by the PSCI FW, let's initialize a corresponding PM domain topology by using genpd. This enables a CPU and a group of CPUs, when attached to the topology, to be power-managed accordingly. To trigger the attempt to initialize the genpd data structures let's use a subsys_initcall, which should be early enough to allow CPUs, but also other devices to be attached. The initialization consists of parsing the PSCI OF node for the topology and the "domain idle states" DT bindings. In case the idle states are compatible with "domain-idle-state", the initialized genpd becomes responsible of selecting an idle state for the PM domain, via assigning it a genpd governor. Note that, a successful initialization of the genpd data structures, is followed by a call to psci_set_osi_mode(), as to try to enable the OSI mode in the PSCI FW. In case this fails, we fall back into a degraded mode rather than bailing out and returning error codes. Co-developed-by: Lina Iyer <lina.iyer@linaro.org> Signed-off-by: Lina Iyer <lina.iyer@linaro.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Sudeep Holla <sudeep.holla@arm.com> Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Diffstat (limited to 'drivers/cpuidle/cpuidle-psci.c')
-rw-r--r--drivers/cpuidle/cpuidle-psci.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/cpuidle/cpuidle-psci.c b/drivers/cpuidle/cpuidle-psci.c
index 9d779be27071..edd7a54ef0d3 100644
--- a/drivers/cpuidle/cpuidle-psci.c
+++ b/drivers/cpuidle/cpuidle-psci.c
@@ -34,7 +34,7 @@ static DEFINE_PER_CPU_READ_MOSTLY(struct psci_cpuidle_data, psci_cpuidle_data);
static DEFINE_PER_CPU(u32, domain_state);
static bool psci_cpuidle_use_cpuhp __initdata;
-static inline void psci_set_domain_state(u32 state)
+void psci_set_domain_state(u32 state)
{
__this_cpu_write(domain_state, state);
}
@@ -143,7 +143,7 @@ static const struct of_device_id psci_idle_state_match[] __initconst = {
{ },
};
-static int __init psci_dt_parse_state_node(struct device_node *np, u32 *state)
+int __init psci_dt_parse_state_node(struct device_node *np, u32 *state)
{
int err = of_property_read_u32(np, "arm,psci-suspend-param", state);