From patchwork Wed Jan 6 08:53:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 59226 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp6449718lbb; Wed, 6 Jan 2016 00:54:30 -0800 (PST) X-Received: by 10.98.11.3 with SMTP id t3mr104681550pfi.79.1452070470213; Wed, 06 Jan 2016 00:54:30 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pm5si49114666pac.48.2016.01.06.00.54.29; Wed, 06 Jan 2016 00:54:30 -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 S1752427AbcAFIyU (ORCPT + 11 others); Wed, 6 Jan 2016 03:54:20 -0500 Received: from mail-pf0-f182.google.com ([209.85.192.182]:35989 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752409AbcAFIyR (ORCPT ); Wed, 6 Jan 2016 03:54:17 -0500 Received: by mail-pf0-f182.google.com with SMTP id 65so190447592pff.3 for ; Wed, 06 Jan 2016 00:54:17 -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=c9UqSa7drDRQ6XATqsyoCMGL0UqgTUZ7Qt8jw0kmaPYJf4gVtaTPVNLVBmXiofDZAQ MXli6Ed5yz3CoDVc25vNJp11Ft6vkavqYJgW9h/eHEoiVtIFCn7pzijS3GZtIaL7Yzrb n39l3PIbJIp+OVYzJ9FMphQromdLyxvtgQqZQ= 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=ICBoZkozK/RmkvK7RogNgMKZB6sTiuZXp9lJqQyd/z+nMH3xBFmeaV2xNn6GUO/V8/ +o1uxaBBVpk6ytmRqkq5dV1o0pGUDkFnj4gCNVOsYN8BJsG6USkLiYK+rPicJJD8VyC/ xNAtUVMgDCOEY5B8Swn6finRLTA7+lCOuffeyh3YtZ+g+X4d7KAd6ovTosm53TeVj9AY YGLWd1vcD7AhT8ggHUOCrOnBW9UhYmYUpMR0NBIt3n9qybTG+0RHqfI/D6KjmDU4TlnV /x1k3ytqr+Y4JDs4t4UYlhgTIFVhQu4aoR06flJ0J61XBwfTuAe+JJWS+YfwDiI+XpZL 0OQA== X-Gm-Message-State: ALoCoQnt/GybZrVxc4bbVLywD7aqiMS/UjxfUzP4j9vGQGgkcXbxe7UOluztySMh06Ldh03l3aCd8nEsJZhivLfJBPKQJzyojQ== X-Received: by 10.98.72.67 with SMTP id v64mr140444323pfa.22.1452070456776; Wed, 06 Jan 2016 00:54:16 -0800 (PST) Received: from localhost.localdomain (v17.blockcn.net. [192.241.236.26]) by smtp.gmail.com with ESMTPSA id ux2sm138843233pac.46.2016.01.06.00.54.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Jan 2016 00:54:15 -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 v3 2/4] thermal: power_allocator: change k_pu_ratio/k_po_ratio as percentage Date: Wed, 6 Jan 2016 16:53:46 +0800 Message-Id: <1452070428-2567-3-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1452070428-2567-1-git-send-email-leo.yan@linaro.org> References: <1452070428-2567-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; } /**