Skip to content

Commit a5bb5e0

Browse files
lukaszluba-armrafaeljw
authored andcommitted
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>
1 parent cf61d53 commit a5bb5e0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/soc/samsung/exynos-asv.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include <linux/cpu.h>
1313
#include <linux/device.h>
14+
#include <linux/energy_model.h>
1415
#include <linux/errno.h>
1516
#include <linux/of.h>
1617
#include <linux/pm_opp.h>
@@ -97,9 +98,16 @@ static int exynos_asv_update_opps(struct exynos_asv *asv)
9798
last_opp_table = opp_table;
9899

99100
ret = exynos_asv_update_cpu_opps(asv, cpu);
100-
if (ret < 0)
101+
if (!ret) {
102+
/*
103+
* Update EM power values since OPP
104+
* voltage values may have changed.
105+
*/
106+
em_dev_update_chip_binning(cpu);
107+
} else {
101108
dev_err(asv->dev, "Couldn't udate OPPs for cpu%d\n",
102109
cpuid);
110+
}
103111
}
104112

105113
dev_pm_opp_put_opp_table(opp_table);

0 commit comments

Comments
 (0)