summaryrefslogtreecommitdiff
path: root/kernel/power
diff options
context:
space:
mode:
authorPierre Gondois <Pierre.Gondois@arm.com>2022-03-21 09:57:23 +0000
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-04-13 16:26:17 +0200
commitfc3a9a9858478ab5f8441765a3f9552a0ceba10c (patch)
tree4a85b97562b6d43775f86b7d2892e403d091ce83 /kernel/power
parentbdc21a4d286c6917fe966fd765de99411095b1b4 (diff)
PM: EM: Add artificial EM flag
The Energy Model (EM) can be used on platforms which are missing real power information. Those platforms would implement .get_cost() which populates needed values for the Energy Aware Scheduler (EAS). The EAS doesn't use 'power' fields from EM, but other frameworks might use them. Thus, to avoid miss-usage of this specific type of EM, introduce a new flags which can be checked by other frameworks. Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Signed-off-by: Lukasz Luba <lukasz.luba@arm.com> Reviewed-by: Ionela Voinescu <ionela.voinescu@arm.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/energy_model.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/power/energy_model.c b/kernel/power/energy_model.c
index 0153b0ca7b23..6ecee99af842 100644
--- a/kernel/power/energy_model.c
+++ b/kernel/power/energy_model.c
@@ -384,6 +384,8 @@ int em_dev_register_perf_domain(struct device *dev, unsigned int nr_states,
if (milliwatts)
dev->em_pd->flags |= EM_PERF_DOMAIN_MILLIWATTS;
+ else if (cb->get_cost)
+ dev->em_pd->flags |= EM_PERF_DOMAIN_ARTIFICIAL;
em_cpufreq_update_efficiencies(dev);