To make sure that the capacity value of the last element of the capacity
states vector of the energy model (EM) core (MC) level is equal to the
cpu scale value, use this capacity value to overwrite the cpu scale
value preeviously derived from the Cpu Invariant Engine (CIE).
This patch is necessary as long as there is no complete EM support in
device tree.
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Lukasz Luba <l.luba@partner.samsung.com>
static inline
const struct sched_group_energy * const cpu_core_energy(int cpu)
{
- return core_energy ? energy(cpu, core_energy) : NULL;
+ struct sched_group_energy *sge = NULL;
+
+ if (core_energy) {
+ unsigned long capacity;
+ int max_cap_idx;
+
+ sge = energy(cpu, core_energy);
+ max_cap_idx = sge->nr_cap_states - 1;
+ capacity = sge->cap_states[max_cap_idx].cap;
+
+ printk_deferred("cpu=%d set cpu scale %lu from energy model\n",
+ cpu, capacity);
+
+ topology_set_cpu_scale(cpu, capacity);
+ }
+
+ return sge;
}
static inline