cpufreq: implement max frequency capping

Implements the Max Frequency Capping Engine (MFCE) getter function
cpufreq_scale_max_freq_capacity() to provide the scheduler with a
maximum frequency scaling correction factor for more accurate cpu
capacity handling by being able to deal with max frequency capping.

This scaling factor describes the influence of running a cpu with a
current maximum frequency (policy) lower than the maximum possible
frequency (cpuinfo).

The factor is:

  policy_max_freq(cpu) << SCHED_CAPACITY_SHIFT / cpuinfo_max_freq(cpu)

It also implements the MFCE setter function scale_max_freq_capacity()
which is called from cpufreq_set_policy().

Change-Id: I38ef736cfa587520cf4f97012be25cbb0c5af04d
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Chris Redpath <chris.redpath@arm.com>
Git-commit: 7b619defb7bb44a5f0ab9c68b1d902e0e7db468c
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2 files changed