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: 144744 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp5494940ljj; Tue, 21 Aug 2018 09:41:37 -0700 (PDT) X-Google-Smtp-Source: AA+uWPz9i5bAZ0q5k6Id7fLW4oqLFJAu+aZp/XoGIoH0B+Mv/99l232a4fIbjQC7NGwI/LOu3mqg X-Received: by 2002:a62:6eca:: with SMTP id j193-v6mr54056902pfc.256.1534869697599; Tue, 21 Aug 2018 09:41:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534869697; cv=none; d=google.com; s=arc-20160816; b=EkZp0qH+LbGS42dD+b1wWIODTy0/xg8J3Iixyr11rttgbNp5XsF093/fvXBALPV24x BwfnPp6LJpqbuCaTl+A2XMSCg3+QRTLR+8V5JD2mQKSkf6IdAZE5S4LaJW8lxVaDauzD /TfyxlQ9MFzv/Jr0QhuOKLOJeyAkp3Yah87+BFwoDkNpSUcxIHEgJsYZYYj7NrR+BxuS vvJxzHqs+xwC4DReYYjXhWOKQ+EZnKgQkTldOusq6fS4ASnvVFOttL+BjUdhdlF5yFqc ChfBnT4ddJ/eImA8oBbzjjMy36rnbfPKnND9GmskH69BiRoQuNfV8pT3QCjcNZSxkEZc iq4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=lFOHFpR+amS5x9JJ70VCAqgX8mu7REL4MivPg0W8qQs=; b=MhqWnKTefBvAVKo9wAY0frkU1qzSw1tpOsbTYgHgA+9kpHGaTxGID6YoulzQupl0pG +Kn4JUV6U8fhFYyISZXQaumsV7PWmJ6kER2iAM5TzG0kWDunyY0sFxkyJK6OM6gPpoRb qWPkKlJjqOT2wTykuiorgf4tROCvsWPRXaRQNJIVR2vKdXQXVMWAejfaycKh9w++A5E7 aE5mxC/WNEnPNerUHMGseenlpQRqH5JGHYha444s1FYiqsgGzrBg3PCNfgcO+CeQDuSU 0B/tpIQML1XKDPa26+n1NsIikLBuVfYb0+BVi/8M7GK/cXOLAUg1ZcxMJ/6KqRpUl9QW phUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=THyZtBVk; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e12-v6si13704582pfd.38.2018.08.21.09.41.37; Tue, 21 Aug 2018 09:41:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=THyZtBVk; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726800AbeHUUC1 (ORCPT + 10 others); Tue, 21 Aug 2018 16:02:27 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:39535 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726801AbeHUUC1 (ORCPT ); Tue, 21 Aug 2018 16:02:27 -0400 Received: by mail-wr1-f67.google.com with SMTP id o37-v6so7543987wrf.6 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=klWdJdkTizeyH438750k1qoFKmjQjOe1i4lQbUzfQZ14NTHj1UatsT7NwZVA4pQtsZ SbbwBkgykZJnnw0YwkM/NXhYtDsbR3MUkRW14Vpvqv6gadYjPGpX2qG9DqEZKR8Dp/t+ cV8DkYndo7p86WRKbgycYeLAPPGuzBIRVY20voURW+XkH8KM8iAJh6gwKVGecimyZQmc h/3ieEr/2ndrhctC9Re2U69qPmtp1icdqRbErFOX1mAxGVtJOY+yFS14atgPLjsHgtOO PsAgZnfl2+Mz+Un5RfAwCRMPSoQShdH4mPs9k+xAZsNPJPJrKiCW4VjuO0/3jflYU7SD zzuQ== X-Gm-Message-State: APzg51D7Gzns5RGzedyG/arpbkNGd1jezgK5tybeaEwHvouiTwmg5vS6 fyoEyEm2mm7t1gNtaoQ8cMSM83c5Qu0= 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: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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(-) -- 2.7.4 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):