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: 7965381 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C64679F1CC for ; Wed, 6 Jan 2016 08:54:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 07BD8201BB for ; Wed, 6 Jan 2016 08:54:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F03D62017E for ; Wed, 6 Jan 2016 08:54:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752427AbcAFIyU (ORCPT ); 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 X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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; } /**