lkml.org 
[lkml]   [2018]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] dt-binding: arm/cpus.txt: fix dynamic-power-coefficient unit
Date
The unit of dynamic-power-coefficient is described as mW/MHz/uV^2 whereas
its usage in the code assumes that unit is mW/GHz/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

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

The minimum possible power, when dynamic-power-coefficient equals 1, will
be :
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 * 1 * 1^2 = 1mW which is far more realistic

Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
---
Documentation/devicetree/bindings/arm/cpus.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/cpus.txt b/Documentation/devicetree/bindings/arm/cpus.txt
index 29e1dc5..0148d7d 100644
--- a/Documentation/devicetree/bindings/arm/cpus.txt
+++ b/Documentation/devicetree/bindings/arm/cpus.txt
@@ -274,7 +274,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 mW/GHz/V^2. The
coefficient can either be calculated from power
measurements or derived by analysis.

@@ -285,7 +285,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 GHz.

Example 1 (dual-cluster big.LITTLE system 32-bit):

--
2.7.4
\
 
 \ /
  Last update: 2018-08-21 18:42    [W:0.072 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site