From patchwork Wed Jan 6 08:30:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 59222 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp6440991lbb; Wed, 6 Jan 2016 00:30:51 -0800 (PST) X-Received: by 10.98.64.196 with SMTP id f65mr74008162pfd.110.1452069050401; Wed, 06 Jan 2016 00:30:50 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id or3si32902325pac.233.2016.01.06.00.30.50; Wed, 06 Jan 2016 00:30:50 -0800 (PST) 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; 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; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752300AbcAFIar (ORCPT + 11 others); Wed, 6 Jan 2016 03:30:47 -0500 Received: from mail-pa0-f45.google.com ([209.85.220.45]:34832 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752365AbcAFIao (ORCPT ); Wed, 6 Jan 2016 03:30:44 -0500 Received: by mail-pa0-f45.google.com with SMTP id do7so2003443pab.2 for ; Wed, 06 Jan 2016 00:30:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4AWUBLglojH8u1L1kMFd5S7X+qOldFeiyWRKfPIkE/I=; b=aJL88gBN6wys3oTHlLu5C4t06156AwWBqRuQVl2ZCHCy5mRQ2MB7Nm8nkuMwNTt8V7 YuQpcIqqAoL8O5oEQC1CmPqsBqRnZ93CSP+5qiAtJfE9HRAFf85A4en6hQBe0aC8Gz2A 1+rYakIavfIGP0Y0inaY4/ukc98y8ZoAFeNoc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4AWUBLglojH8u1L1kMFd5S7X+qOldFeiyWRKfPIkE/I=; b=lJ6Xo0SSqi3gAyBeBpls3kuzl6pKM82Ivur0WX9Z0Vr3LKBvxtbSlaBrpFvFuaQHPD eXRtJwb9vuXHaf2BwVaTYFXNqQps4aRZeDwGx+rCy5PBbXdLzAZ+9K1G6fFFg6mk8qjT RDMDGZ0akliecgcQ1vkoJYW5mIVYb8sr0HA7L4QLQivKnjB/3FwXjUUsMPa+cC4CvlVG 0Ys0tDhKKILXvzMy+6l+0AhD4w/3P5I7NcIWeLiPjLd0peoF1o+6hxElddEvlQJJJ/rU H+f+1NCOyRjEnX9R7NJKekKXnZCuMYtWdsl1dznL16iukameZCsKixzp9Z0ry7AclFVV W9RQ== X-Gm-Message-State: ALoCoQnN7p0OafUQxgcJXOmfLLm93ODUGXwSBQ91cKGmEIUKF5rAWhCl2m1J/pQtZCz9ImXU0ExmyDF1BKEr/fHuDRuyeZyK7Q== X-Received: by 10.66.142.201 with SMTP id ry9mr142303544pab.89.1452069043535; Wed, 06 Jan 2016 00:30:43 -0800 (PST) Received: from localhost.localdomain (v17.blockcn.net. [192.241.236.26]) by smtp.gmail.com with ESMTPSA id f24sm133416478pff.68.2016.01.06.00.30.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Jan 2016 00:30:42 -0800 (PST) From: Leo Yan To: Jonathan Corbet , Zhang Rui , Eduardo Valentin , Javi Merino , Punit Agrawal , Daniel Kurtz , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Daniel Thompson Cc: Leo Yan Subject: [PATCH v2 2/4] thermal: power_allocator: change k_pu_ratio/k_po_ratio as percentage Date: Wed, 6 Jan 2016 16:30:21 +0800 Message-Id: <1452069023-32149-3-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1452069023-32149-1-git-send-email-leo.yan@linaro.org> References: <1452069023-32149-1-git-send-email-leo.yan@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Change k_pu_ratio/k_po_ratio as percentage value, so can set these values from sys file nodes with high resolution. Signed-off-by: Leo Yan --- drivers/thermal/power_allocator.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/thermal/power_allocator.c b/drivers/thermal/power_allocator.c index 76d2b47..c5f36fa 100644 --- a/drivers/thermal/power_allocator.c +++ b/drivers/thermal/power_allocator.c @@ -156,10 +156,10 @@ static void estimate_pid_constants(struct thermal_zone_device *tz, return; if (!tz->tzp->k_po_ratio || force) - tz->tzp->k_po_ratio = 1; + tz->tzp->k_po_ratio = 100; if (!tz->tzp->k_pu_ratio || force) - tz->tzp->k_pu_ratio = 2; + tz->tzp->k_pu_ratio = 200; if (!tz->tzp->k_i || force) tz->tzp->k_i = int_to_frac(10) / 1000; @@ -169,9 +169,9 @@ static void estimate_pid_constants(struct thermal_zone_device *tz, */ tz->tzp->k_po = int_to_frac(tz->tzp->k_po_ratio * sustainable_power) / - temperature_threshold; + temperature_threshold / 100; tz->tzp->k_pu = int_to_frac(tz->tzp->k_pu_ratio * sustainable_power) / - temperature_threshold; + temperature_threshold / 100; } /**