Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp235901imm; Wed, 22 Aug 2018 03:18:52 -0700 (PDT) X-Google-Smtp-Source: AA+uWPz98/CVvTJdmJrFyyN7CydZGrlhnD6qDTtaz2Ng+t9Boyw9/F2NXRDqm46Qfh3hrWZGpBYj X-Received: by 2002:a17:902:ac8f:: with SMTP id h15-v6mr22152284plr.161.1534933132887; Wed, 22 Aug 2018 03:18:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534933132; cv=none; d=google.com; s=arc-20160816; b=rHuC3X7CZ1+vXga8C4o+hVz3XBQ02zixZH5JfLm0syv33jgSQMWJxDsZ3VB2bKptQj beJzYmmqSvvvVYRSnCxMh9i53W7BH9tfvDzGfU2NHdFlcieTmTBRz/jGmLZMH39VRgzO k2ta07zZLOhkkAZzFLm7JQBMbSfg0iYf54t8AxxWzH0Mr6A+SUQtNtHRviUc9dGQzNNQ ZfE9wqkCWproILO9Pn9vBgOVEx6IDW0FdpUe21aKvTkSj52Rfzxs7uEJEv9ql81Si59m Q0rUGbMnKG7Fd1WwcRfgSqUbU2f25dJDUnqWEB/AiWpJcwc64WK+J882GTQ/nD77uN/Y AwkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from :arc-authentication-results; bh=8VD+nv3Pv3TiS1YguhBIztY1CqQrTVx8+1c7NXuCLuY=; b=s0tVVw8ZMMMBGsiw45NI9vveYwwTjM7kFWFb/tciipPNB6caqICw2ajsj1FcYuLiZh fN/bVwGN2iioYyaqCeU/ibv8fTBt5mcu3APlhGAaTJnjOLJhIRy8lRFHZMsPU1ErvL57 JQPNIU+E6SSFpNH0ZsQ6wyRNrkQJYPXGIFhyZp1ADbRSi3//JPqfnvUqdXmLGKdTL7Nj SbT16Snqg0FTI0pWHr2jBV/oHqMwaacdWplmMnRiWTMOdVBLh6jA+djcW1jzoMw4jbau mHxaAhmx4Rs/i3sJIuovlCuU3Jbvzf+3XoAt6+sPb3qylX27R4hiBZUZFmFW873WA5vQ ZPsQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f62-v6si1618586pfg.165.2018.08.22.03.18.13; Wed, 22 Aug 2018 03:18:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728522AbeHVNfj (ORCPT + 99 others); Wed, 22 Aug 2018 09:35:39 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:59318 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727754AbeHVNfj (ORCPT ); Wed, 22 Aug 2018 09:35:39 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6B17380D; Wed, 22 Aug 2018 03:11:24 -0700 (PDT) Received: from localhost (e105922-lin.emea.arm.com [10.4.13.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DFE243F5BC; Wed, 22 Aug 2018 03:11:23 -0700 (PDT) From: Punit Agrawal To: Vincent Guittot Cc: robh+dt@kernel.org, mark.rutland@arm.com, devicetree@vger.kernel.org, edubezval@gmail.com, viresh.kumar@linaro.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [PATCH] dt-binding: arm/cpus.txt: fix dynamic-power-coefficient unit References: <1534869685-22221-1-git-send-email-vincent.guittot@linaro.org> Date: Wed, 22 Aug 2018 11:11:22 +0100 In-Reply-To: <1534869685-22221-1-git-send-email-vincent.guittot@linaro.org> (Vincent Guittot's message of "Tue, 21 Aug 2018 18:41:25 +0200") Message-ID: <87ftz6ww1h.fsf@e105922-lin.cambridge.arm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vincent, Thanks for the patch. One comment about the choice of units below. Vincent Guittot writes: > 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 Instead of choosing GHz as the base, I'd prefer to use uW/MHz/V^2. It'll avoid introducing fractional GHz value for frequency calculations. > 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 Which would then translate to - power (mW) = power (uW) / 1000 = capacitance * freq_mhz * (voltage_mv/1000)^2 Thanks, Punit > > 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):