Commit 29e5f944 authored by Vincent Guittot's avatar Vincent Guittot Committed by Rob Herring

dt-binding: arm/cpus.txt: fix dynamic-power-coefficient unit

The unit of dynamic-power-coefficient is described as mW/MHz/uV^2 whereas
its usage in the code assumes that unit is uW/MHz/V^2

In drivers/thermal/cpu_cooling.c, the code is :

power = (u64)capacitance * freq_mhz * voltage_mv * voltage_mv;
do_div(power, 1000000000);

which can be summarized as :
power (mW) = capacitance * freq_mhz/1000 * (voltage_mv/1000)^2
or
power (mW) = (capacitance * freq_mhz * (voltage_mv/1000)^2) / 1000
then
power (mW) = power (uW) / 1000
so
power (uW) = capacitance * freq_mhz * (voltage_mv/1000)^2

Furthermore, if we test basic values like :
voltage_mv = 1000mV = 1V
freq_mhz = 1000Mhz

The minimum possible power, when dynamic-power-coefficient equals 1, will
be with current unit:
min power = 1 * 1000  * (1000000)^2 = 10^15 mW
which is not realistic

With the unit used by the code, the min power is
min power =  1 * 1000 * 1^2 = 1000uW = 1mW which is far more realistic
Signed-off-by: default avatarVincent Guittot <vincent.guittot@linaro.org>
Acked-by: default avatarPunit Agrawal <punit.agrawal@arm.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
parent f858927f
......@@ -276,7 +276,7 @@ described below.
Usage: optional
Value type: <prop-encoded-array>
Definition: A u32 value that represents the running time dynamic
power coefficient in units of mW/MHz/uV^2. The
power coefficient in units of uW/MHz/V^2. The
coefficient can either be calculated from power
measurements or derived by analysis.
......@@ -287,7 +287,7 @@ described below.
Pdyn = dynamic-power-coefficient * V^2 * f
where voltage is in uV, frequency is in MHz.
where voltage is in V, frequency is in MHz.
Example 1 (dual-cluster big.LITTLE system 32-bit):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment