Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

soc: samsung: exynos-asv: Update Energy Model after adjusting voltage

When the voltage for OPPs is adjusted there is a need to also update
Energy Model framework. The EM data contains power values which depend
on voltage values. The EM structure is used for thermal (IPA governor)
and in scheduler task placement (EAS) so it should reflect the real HW
model as best as possible to operate properly.

Based on data on Exynos5422 ASV tables the maximum power difference might
be ~29%. An Odroid-XU4 (with a random sample SoC in this chip lottery)
showed power difference for some OPPs ~20%. Therefore, it's worth to
update the EM.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Lukasz Luba and committed by
Rafael J. Wysocki
a5bb5e08 cf61d53b

+9 -1
+9 -1
drivers/soc/samsung/exynos-asv.c
··· 11 11 12 12 #include <linux/cpu.h> 13 13 #include <linux/device.h> 14 + #include <linux/energy_model.h> 14 15 #include <linux/errno.h> 15 16 #include <linux/of.h> 16 17 #include <linux/pm_opp.h> ··· 98 97 last_opp_table = opp_table; 99 98 100 99 ret = exynos_asv_update_cpu_opps(asv, cpu); 101 - if (ret < 0) 100 + if (!ret) { 101 + /* 102 + * Update EM power values since OPP 103 + * voltage values may have changed. 104 + */ 105 + em_dev_update_chip_binning(cpu); 106 + } else { 102 107 dev_err(asv->dev, "Couldn't udate OPPs for cpu%d\n", 103 108 cpuid); 109 + } 104 110 } 105 111 106 112 dev_pm_opp_put_opp_table(opp_table);