Message ID | 20231027080400.56703-5-vincent.guittot@linaro.org (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | consolidate and cleanup CPU capacity | expand |
Context | Check | Description |
---|---|---|
conchuod/vmtest-for-next-PR | fail | PR summary |
conchuod/patch-4-test-1 | fail | .github/scripts/patches/build_rv32_defconfig.sh |
conchuod/patch-4-test-2 | fail | .github/scripts/patches/build_rv64_clang_allmodconfig.sh |
conchuod/patch-4-test-3 | fail | .github/scripts/patches/build_rv64_gcc_allmodconfig.sh |
conchuod/patch-4-test-4 | fail | .github/scripts/patches/build_rv64_nommu_k210_defconfig.sh |
conchuod/patch-4-test-5 | fail | .github/scripts/patches/build_rv64_nommu_virt_defconfig.sh |
conchuod/patch-4-test-6 | success | .github/scripts/patches/checkpatch.sh |
conchuod/patch-4-test-7 | success | .github/scripts/patches/dtb_warn_rv64.sh |
conchuod/patch-4-test-8 | success | .github/scripts/patches/header_inline.sh |
conchuod/patch-4-test-9 | success | .github/scripts/patches/kdoc.sh |
conchuod/patch-4-test-10 | success | .github/scripts/patches/module_param.sh |
conchuod/patch-4-test-11 | success | .github/scripts/patches/verify_fixes.sh |
conchuod/patch-4-test-12 | success | .github/scripts/patches/verify_signedoff.sh |
diff --git a/include/linux/energy_model.h b/include/linux/energy_model.h index b9caa01dfac4..1b0c8490d4bd 100644 --- a/include/linux/energy_model.h +++ b/include/linux/energy_model.h @@ -204,6 +204,14 @@ struct em_perf_state *em_pd_get_efficient_state(struct em_perf_domain *pd, return ps; } +#ifndef arch_scale_freq_ref +static __always_inline +unsigned int arch_scale_freq_ref(int cpu) +{ + return 0; +} +#endif + /** * em_cpu_energy() - Estimates the energy consumed by the CPUs of a * performance domain @@ -224,7 +232,7 @@ static inline unsigned long em_cpu_energy(struct em_perf_domain *pd, unsigned long max_util, unsigned long sum_util, unsigned long allowed_cpu_cap) { - unsigned long freq, scale_cpu; + unsigned long freq, ref_freq, scale_cpu; struct em_perf_state *ps; int cpu; @@ -241,11 +249,11 @@ static inline unsigned long em_cpu_energy(struct em_perf_domain *pd, */ cpu = cpumask_first(to_cpumask(pd->cpus)); scale_cpu = arch_scale_cpu_capacity(cpu); - ps = &pd->table[pd->nr_perf_states - 1]; + ref_freq = arch_scale_freq_ref(cpu); max_util = map_util_perf(max_util); max_util = min(max_util, allowed_cpu_cap); - freq = map_util_freq(max_util, ps->frequency, scale_cpu); + freq = map_util_freq(max_util, ref_freq, scale_cpu); /* * Find the lowest performance state of the Energy Model above the