From patchwork Fri Apr 10 22:12:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 212339 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D431C2D0EC for ; Fri, 10 Apr 2020 22:13:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 231C2218AC for ; Fri, 10 Apr 2020 22:13:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="N/MiSR6N" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726780AbgDJWNT (ORCPT ); Fri, 10 Apr 2020 18:13:19 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:38966 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726762AbgDJWNG (ORCPT ); Fri, 10 Apr 2020 18:13:06 -0400 Received: by mail-wr1-f67.google.com with SMTP id p10so3869213wrt.6 for ; Fri, 10 Apr 2020 15:13:04 -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:in-reply-to:references; bh=7Mico83Ts6Z9TeO582WyGQ/zwaTm+b6l1oxUTdnb7r8=; b=N/MiSR6NAmnE1ZrkABq4zlrlK8ua6kZyZhYeAeV8XChVqFef8CbClWF+vRARHOEZws uoC+n58vC0vHwYL/PFmDYPIala8qQCtT4xtDLzyFO2fTWbbhoJzzixgZO/IUW1W964cM LrxQl8n1RMbilMAVUhU7nh4PsEbyOikPFu9yk4B3p4HwumyAIB/e6e7GflLnkcZrGBNJ 8Bb2xsyYntBXGkIX/pN7Jf3FMySqgwAAKfh/f5RBq/a97v/+zz1MSNLVuZdBeb/3uYUP ym1CDLh2gWhGJ3EOPXdnLLvX1mqbCdtR6mvHek4d6FFkF4NRVeOFSiphppYQcSly3tjs wBSA== 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:in-reply-to :references; bh=7Mico83Ts6Z9TeO582WyGQ/zwaTm+b6l1oxUTdnb7r8=; b=eXPnQpp+XOaqMltpx/iiSVWU5smKkw4hZlLpumw8jwd+3AiOgt1qIiwKplnNpvShDQ Vcu0FagUlb6V9Aue7u/HQ0qARQEKh7jGgO5sMyKXHGiQpzW2CyR73GpIDEWH1rub2D77 SEim4XLVLFLKk+KKly87L/jfqOjvlVIaiE+lADCFOSfsXTuSHyxLfrpOGt9f0QyUBgwo 3CAQ+M1aXXWaaCgwZCAWb8jJfWV0lsvpjOVXTsqXfb50PkZbiteixRTaiv12Ho6Bvus4 ypykeoy4i4dmaugj+Oor5UpBhhcD3SFGyN9YM1Q5N74O+lGUh9zBIezLtNFvjTW+3osY rhCw== X-Gm-Message-State: AGi0PuavenR4V0oGEDItRrcZAe5tkxCM8q/I8cvb3dVcudVqWX5yGtFc FtOO3+frBZxOS8Hg0nlHOsln4A== X-Google-Smtp-Source: APiQypJAsoxzI6Q0F859Mb3noemMFuNzQMvldjTr5RSJw1zMei5wjai3acaaYh68NVrRQ5pUPrZrsw== X-Received: by 2002:a5d:5688:: with SMTP id f8mr6518986wrv.245.1586556783449; Fri, 10 Apr 2020 15:13:03 -0700 (PDT) Received: from localhost.localdomain (lns-bzn-59-82-252-135-148.adsl.proxad.net. [82.252.135.148]) by smtp.gmail.com with ESMTPSA id b14sm4687952wrw.83.2020.04.10.15.13.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Apr 2020 15:13:02 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rui.zhang@intel.com Cc: amit.kucheria@verdurent.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org (open list:THERMAL) Subject: [PATCH 4/6] thermal: power_allocator: Remove useless test Date: Sat, 11 Apr 2020 00:12:33 +0200 Message-Id: <20200410221236.6484-5-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200410221236.6484-1-daniel.lezcano@linaro.org> References: <20200410221236.6484-1-daniel.lezcano@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The function power_actor_set_power() does check if the specified cooling device is a power actor. Call the function and handle the return code like what do the other calls to power_actor_* functions. Signed-off-by: Daniel Lezcano --- drivers/thermal/power_allocator.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/power_allocator.c b/drivers/thermal/power_allocator.c index f8e4219cf5de..fd7c8de02250 100644 --- a/drivers/thermal/power_allocator.c +++ b/drivers/thermal/power_allocator.c @@ -427,11 +427,10 @@ static int allocate_power(struct thermal_zone_device *tz, if (instance->trip != trip_max_desired_temperature) continue; - if (!cdev_is_power_actor(instance->cdev)) + if (power_actor_set_power(instance->cdev, instance, + granted_power[i])) continue; - power_actor_set_power(instance->cdev, instance, - granted_power[i]); total_granted_power += granted_power[i]; i++; From patchwork Fri Apr 10 22:12:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 212340 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27348C2BB55 for ; Fri, 10 Apr 2020 22:13:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EE23520A8B for ; Fri, 10 Apr 2020 22:13:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="cwCobIiC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726791AbgDJWNI (ORCPT ); Fri, 10 Apr 2020 18:13:08 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:40927 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726765AbgDJWNG (ORCPT ); Fri, 10 Apr 2020 18:13:06 -0400 Received: by mail-wr1-f67.google.com with SMTP id s8so3870953wrt.7 for ; Fri, 10 Apr 2020 15:13:05 -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:in-reply-to:references; bh=llenZ0suLw6do3znZz93SYo8GX9BjIHqcVpMde2jjyQ=; b=cwCobIiCE2a2mjAnkofCunPBk+7umwjxVTgVuitn1olEYefEHvZ249OUkRHdAk7pwz ZcZEI4e7xACErBW0VB0jSW7/OBQQ7T9K3RnPiKvod8K6MCUdr6ioCleJoWt+3cQJpBeT tvOgAE9871nhq6h/UZMh95s3zj9QIQUbJMQTOHiEF0ea3zORrNTnnAIJplXgihfgvF2u cCSo9rK6uNPxp8ee70mp+z+/xfG08RNaL9Uy+C4IK5vvm8sK0onQGf01RyVb0hXVt9M5 Hfau4KzuDNebjzyEUoW2TBCTE9YSLzGncrleGn/Y9HreeXAuuQpQ79AD/QWnVoU6xM8C DQyA== 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:in-reply-to :references; bh=llenZ0suLw6do3znZz93SYo8GX9BjIHqcVpMde2jjyQ=; b=Z5qiY9KrtNzU2N7Pclszoremj+MjANILTMIngokKhKC2/G3jCnsmTydPPfQDIqJMaJ T+JHn0R0R3hlDVmd6pFMgNvHPhLRI/lSC9uioUU/hvYMzxRQWnbSis1fwy0O6QYvzKAN fo/haCusQHD3QpW2/TQ373dwWE2l5G4OMsSK+7ieaauCKDIk3hqlvyH4EtEU+dEDfk8C FjW+syUCxyxKkhdqBrBOjCjsSy2IH8W2+akVKwzvgbfGiqDsJi7zJamSwXPccT+R6CY+ Dygnol6PJw5z5eSV1Gtq7cKdWjA7jZzBLfMqLHJpPlOkYH2+xS8bGZebt/0x7EnOhXOQ CxMA== X-Gm-Message-State: AGi0PuY7BPWoYJ+DJHO59KttXCR5JkiaSRrd2yGJ9vvcGeBA61PUVJN6 r2WeLgpelpCelZRP2xQME7TJLBVddHI= X-Google-Smtp-Source: APiQypL56/ywMxjjn+QWFh16svA+TLTAIFUlP6upenDKZquE4BHfXKiHuGvX23Z7ZGxtydPxiOLMtQ== X-Received: by 2002:adf:9cc8:: with SMTP id h8mr6405064wre.167.1586556784930; Fri, 10 Apr 2020 15:13:04 -0700 (PDT) Received: from localhost.localdomain (lns-bzn-59-82-252-135-148.adsl.proxad.net. [82.252.135.148]) by smtp.gmail.com with ESMTPSA id b14sm4687952wrw.83.2020.04.10.15.13.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Apr 2020 15:13:04 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rui.zhang@intel.com Cc: amit.kucheria@verdurent.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org (open list:THERMAL) Subject: [PATCH 5/6] thermal: core: Move the call to thermal_cdev_udpate() to the power allocator Date: Sat, 11 Apr 2020 00:12:34 +0200 Message-Id: <20200410221236.6484-6-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200410221236.6484-1-daniel.lezcano@linaro.org> References: <20200410221236.6484-1-daniel.lezcano@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org All the calls to the thermal_cdev_update() are in the governors except one in the power_actor_set_power(). Move the update right after the call to power_actor_set_power(), the function will be located in the IPA governor. Signed-off-by: Daniel Lezcano --- drivers/thermal/power_allocator.c | 2 ++ drivers/thermal/thermal_core.c | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/power_allocator.c b/drivers/thermal/power_allocator.c index fd7c8de02250..339442925dfe 100644 --- a/drivers/thermal/power_allocator.c +++ b/drivers/thermal/power_allocator.c @@ -433,6 +433,8 @@ static int allocate_power(struct thermal_zone_device *tz, total_granted_power += granted_power[i]; + thermal_cdev_update(instance->cdev); + i++; } diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 052f77b0b0ef..a6b8c0240656 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -614,7 +614,6 @@ int power_actor_set_power(struct thermal_cooling_device *cdev, return ret; instance->target = state; - thermal_cdev_update(cdev); return 0; }