From patchwork Tue Aug 21 16:41:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 960536 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="THyZtBVk"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41vxJz0Wkwz9s78 for ; Wed, 22 Aug 2018 02:41:39 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726917AbeHUUC1 (ORCPT ); Tue, 21 Aug 2018 16:02:27 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:36280 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726854AbeHUUC1 (ORCPT ); Tue, 21 Aug 2018 16:02:27 -0400 Received: by mail-wr1-f66.google.com with SMTP id m27-v6so10182597wrf.3 for ; Tue, 21 Aug 2018 09:41:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=lFOHFpR+amS5x9JJ70VCAqgX8mu7REL4MivPg0W8qQs=; b=THyZtBVkw0x53a14WAFgTnz3v6p60e5IDwa3P+1sHdJL7wzE1SutmJg0Ujt5mi/jK7 bhk1vXf7kRlxGD5F1c4+78pT6JMFl0vqklzjvvmgmxcMPZfVn6O5sdwaQAY17LGBaKKo ODeIW27jOkyDzvNxLTBPo/inm9si3QgA0ewW8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=lFOHFpR+amS5x9JJ70VCAqgX8mu7REL4MivPg0W8qQs=; b=Gl/0H+kKb5V5XszhLIzO0T3eUso9sh+3rXmj75lxl49/7Fy/mN27TNvZKyBNJBNTiS 2svKZO6h8iE5JITgVLkY7eYv7eKMFlT5eohsRImtBKDilOB6pjauLRRpVO6i1RcqvOWm n24sGNeYsTEkbtkv9zpjEBnyWlBTA/zNxXuNmWCZk4DF/C9Du9lIXOgUDzK504daKC19 zeKw9kFzI+JPqaENBv4Cd/hTyNHET9ENW6u1urCr/dXNcQ5OmPCVVQxibff3bs6UF8hb xsq7BmbwuRnwf92EscvweQqJwiRVixsTC97MJqr/ELZToT0AfL5Ggjcuy3Tvp3FQB23O zoEw== X-Gm-Message-State: APzg51B1I/8rcJaX6SVTeQ+DiWPtsQ6eeIG7SKgcyIP+y8DQa9I2XCd4 33I9AhVTQBQovCQWhQ11Il18JA== X-Google-Smtp-Source: ANB0Vdafax72hB2E5n3+W+szE83xbu7Ew/QPp2YoHC6c6cLDKeAmtXrBiZJTBW1sV9ycwAhydh12qg== X-Received: by 2002:adf:fa4d:: with SMTP id y13-v6mr9706329wrr.155.1534869694602; Tue, 21 Aug 2018 09:41:34 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:f:6020:3439:d494:ce42:6719]) by smtp.gmail.com with ESMTPSA id l16-v6sm2165294wmc.38.2018.08.21.09.41.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Aug 2018 09:41:33 -0700 (PDT) From: Vincent Guittot To: robh+dt@kernel.org, mark.rutland@arm.com, devicetree@vger.kernel.org, punit.agrawal@arm.com Cc: edubezval@gmail.com, viresh.kumar@linaro.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Vincent Guittot Subject: [PATCH] dt-binding: arm/cpus.txt: fix dynamic-power-coefficient unit Date: Tue, 21 Aug 2018 18:41:25 +0200 Message-Id: <1534869685-22221-1-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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 --- 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: 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):