From patchwork Fri Jul 10 13:51:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 235237 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp474465ilg; Fri, 10 Jul 2020 06:52:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCzT0MIb6Ls5x+Rj/uAdXjRdy80NwzZkIcATs+zE5jR1GhR2BiNBiyDHjz1t4QdwAoekg5 X-Received: by 2002:a17:906:dce:: with SMTP id p14mr59605837eji.442.1594389120895; Fri, 10 Jul 2020 06:52:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594389120; cv=none; d=google.com; s=arc-20160816; b=NtQEqPlF6SQFizDnMzer+hncYnRZG8MCXpSRNt8AIS58tYgT2emsO89A5oQ3ACWgka YB7no1RcCBNyoZVFEAPYFb/VDz1tT0TZxEAMCLtOVkSZZcx3eXB42GowR7wF/vvgXsqz 5LHl/CCrv2gTMyj4rXh3gaEGJndsCrYOmhkgOgjk2qCyqn9HupB0WnAiNB0gOGOsQUWC YrX1AwrirK3eoSKLs0omEerz7QRAYqyZ2qRAiqjE7EfB1YEiO2VtgW3VOA93cuWa0wgP A6ZRJk8aPA2jNtD8SAXQCaj+/095fd+/SNuf2/TahWgrGzf8lT1kkSe8vG5cOxXh5mX2 6XPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=GAypbVKRAUehaDEHEafPSFVtTwjQwSh5L9nGPiVfRD4=; b=S6vCJaATIuiJh8SCmSUGSm6TgTskmzqp9cAcTSPndwm740ogposo9G8Umjp886eWi5 pNnCHn2yL2SE/23xZaY3mveMMEKuGnJWE/nOeVsVb3I/TAiJ8v39lOEboq+4MCjW/zv8 QCLLezGWc1j1kW1LRS5SZM6QjhAIT9tm5MDnP7siwEQ1E1ZBj/pd1pOKkLJ0LWTkF5aj tHwHtyAp/KuWG2/8iR5Y52iVcEdepsEBCMkZNMCfmvN50JBLpxS9px3MxbwEA6ANPYnv QygdQbi7KRAYzJewvDbfgHFqj4Xbvdexc3gEi37OyDzk+7o8n30tCyYvDcHYGhMOBhoM q9xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CA+9yDnh; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n9si4325793edo.13.2020.07.10.06.52.00; Fri, 10 Jul 2020 06:52:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CA+9yDnh; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727998AbgGJNv7 (ORCPT + 10 others); Fri, 10 Jul 2020 09:51:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727947AbgGJNv6 (ORCPT ); Fri, 10 Jul 2020 09:51:58 -0400 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8DB6C08C5DD for ; Fri, 10 Jul 2020 06:51:57 -0700 (PDT) Received: by mail-qt1-x843.google.com with SMTP id d27so4413623qtg.4 for ; Fri, 10 Jul 2020 06:51:57 -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 :mime-version:content-transfer-encoding; bh=GAypbVKRAUehaDEHEafPSFVtTwjQwSh5L9nGPiVfRD4=; b=CA+9yDnhIZFhliXGonoDDI0Pf9kKnyIifhYylpMmd48sxLE/5QJhdQhzgxwXXehSW5 nh9FivHzuKoQlzN+dUjKjAojbft8kvDn/DqULyapUt96chfxrscbtMpB93aaf5eJUYpe +lDuS2qx9lFQ5mtYpVJ4oLJWvMlTyU/UzM19OEnHYyPASya0N8rQ10rm6Wy7GYreh4g6 7PQZ7gT43j8OAJRPj9hMPEJDfAd67UrD3xKgDWuznD1B5uPTU+xOx98azX8yltiW+IfW fVvsqNbtkmjaq+PLQE4/ioceYkTdHoXbK60++j3nY88E4OI2PQyH+uNFnN4kWHd167nu Ei1w== 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:mime-version:content-transfer-encoding; bh=GAypbVKRAUehaDEHEafPSFVtTwjQwSh5L9nGPiVfRD4=; b=BgBOUSciQkWKzOHHVpoM/hxDhpZ3VingO88Tr7Zslm0Gg8lFuNqf2zjXzoCPpoqL0R qxp7yi5yc1t9e+Z0ZDs0ttAA3AW5IjrSXvRCpqjW9Twx8IuSHoZ9lXJF8kXTzJMgdHM2 HrkvDS4rY7Fr4Ta/1PVjVW6Jq0GiyYHXCZVX+vPydecZXQSzW9hzOPtobKuj9s5Lpn6g 3fGrBp0WWSj37BKVvuVsi+Gt0UWYbyJtw3+tYl9Zx8C2kiD4IqE/i8mH1HXKzzf3EZ08 pGU+AJBUT7zxKiZgaGLiTo75aNn0hxio3A+3pagDdpy8vuntvMJ7S/qott5XZwZJz4Gv iGeA== X-Gm-Message-State: AOAM531YyW+8C/bjNl9kYo5H+acltZMaHjLManV8lvNxow57egrbRkjj xqmAWfIrYzIk3xyRLQrL7hwYmg== X-Received: by 2002:ac8:1a0f:: with SMTP id v15mr72490794qtj.136.1594389117114; Fri, 10 Jul 2020 06:51:57 -0700 (PDT) Received: from pop-os.fios-router.home (pool-71-255-246-27.washdc.fios.verizon.net. [71.255.246.27]) by smtp.googlemail.com with ESMTPSA id h197sm7574059qke.51.2020.07.10.06.51.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2020 06:51:56 -0700 (PDT) From: Thara Gopinath To: daniel.lezcano@linaro.org, rui.zhang@intel.com, robh+dt@kernel.org Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 1/4] dt-bindings:thermal:Add cold trip point type Date: Fri, 10 Jul 2020 09:51:51 -0400 Message-Id: <20200710135154.181454-2-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200710135154.181454-1-thara.gopinath@linaro.org> References: <20200710135154.181454-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Extend thermal trip point type property to include "cold" trip type indicating point in the temperature domain below which a warming action must be intiated. Signed-off-by: Thara Gopinath --- Documentation/devicetree/bindings/thermal/thermal.txt | 1 + 1 file changed, 1 insertion(+) -- 2.25.1 diff --git a/Documentation/devicetree/bindings/thermal/thermal.txt b/Documentation/devicetree/bindings/thermal/thermal.txt index f78bec19ca35..1689d9ba1471 100644 --- a/Documentation/devicetree/bindings/thermal/thermal.txt +++ b/Documentation/devicetree/bindings/thermal/thermal.txt @@ -87,6 +87,7 @@ Required properties: "active": A trip point to enable active cooling "passive": A trip point to enable passive cooling "hot": A trip point to notify emergency + "cold": A trip point to enable warming "critical": Hardware not reliable. Type: string From patchwork Fri Jul 10 13:51:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 235239 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp474615ilg; Fri, 10 Jul 2020 06:52:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8GejxZPhInCUdwSXT5CbDOkcC3rdLkxMe7PIIK/HBnClam3RhyHdJ4TmHdX7ejC395lLQ X-Received: by 2002:a05:6402:202e:: with SMTP id ay14mr77385763edb.233.1594389131335; Fri, 10 Jul 2020 06:52:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594389131; cv=none; d=google.com; s=arc-20160816; b=ARq2MEw0XOPcMFNOLRr+qaxudkxbubKHz4BuNB/c+oWNV3XdXxJbrcFcwYlKND/RUV nMtJ1AjXYOQcyllkFRrlh5+AqeYb0F30SQVYTSxsF5PuZRXuPElec+N5OKLZaC3j/8bW IUJFMoS7z2mdXDoBJvcqpUWE0cToPXNwlpoy2JKRMgBkOF9Fjr7wYoBqVcPjTI6XzL5I 7GOSKx+1aHDG8vhLYHDteO2xGThUNYxJ4cUBSHgAC8bQ3Wu/5V9xLROgTWb2b11lIGlg ZEsNg/BCjrErIEJQQrb6b044wIF2sy21R86KcS9Y55gW2MGqeKBH0Cze0AkH8Q9V95Hv UxIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0Hf2EQhK7szwaDYevZJPMqkaBsz8dSW+eokQabw43h0=; b=vnXgsHn1kVEuNFnJIMWHPyf3cD/oZj07M0ix0ga80rIWhRqCLmnpTHYN4O9Y1fTPey BlxVnWGnHDAhyM59QT0prTbeG3xNS0KawWrCV2zv2Su94nYSPYuPAGEhM1wakJMNllCT 8Q+6CWcQtWsxHwvf5Mugt00QEO2TytEJmAuOru6E89SXxeYDtndg9odBx44s4RexGf+z lr1CBehuiO+R3c3t+c2oz1AgmHmZthdHqBmsPqyyXLHlkQ6H/RRlz6qEA/j9fKQRhpZY afvsGsAbso1dLdLFgfKWLgI1An2qI/3Id6WA9fzuY+s/gBSnXrsEUUvSfMv6V8pehWrw +wWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OFVDGDmD; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu2si4562216edb.423.2020.07.10.06.52.11; Fri, 10 Jul 2020 06:52:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OFVDGDmD; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728024AbgGJNwK (ORCPT + 10 others); Fri, 10 Jul 2020 09:52:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728053AbgGJNwA (ORCPT ); Fri, 10 Jul 2020 09:52:00 -0400 Received: from mail-qv1-xf43.google.com (mail-qv1-xf43.google.com [IPv6:2607:f8b0:4864:20::f43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33AECC08E6DC for ; Fri, 10 Jul 2020 06:52:00 -0700 (PDT) Received: by mail-qv1-xf43.google.com with SMTP id u8so2551344qvj.12 for ; Fri, 10 Jul 2020 06:52:00 -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 :mime-version:content-transfer-encoding; bh=0Hf2EQhK7szwaDYevZJPMqkaBsz8dSW+eokQabw43h0=; b=OFVDGDmDk2rsL22Q4OLH5sVL2ZMmlniVU/Ydrcah/Q7eV5oVyW+i2owNIXJhdUgzu4 oJL8XGEIhQIMoMQKKk24I/CCznLtco1zHe/7pSq0RjsXKN7TUI3dW8OEs7hGHrHaE0w2 gk4mkcdbZGQHm3gd8DYfTS3DKBkKfQuhlLQm3W3tAmhQ81D4Szi55btLM8eufONuYmBB Hc3g972A2kAj/pbdHNI06mO7dqcLMtyMo5MMFDwcMyYrghUJvMDovI2b200HTnqv/aPJ pj7VCHr2BRDkIQUVek+yXbOzYf8eUdWVo3SDjYkgjCuv/kLO1R5doaaaqyFYovc0wxYz ZtPQ== 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:mime-version:content-transfer-encoding; bh=0Hf2EQhK7szwaDYevZJPMqkaBsz8dSW+eokQabw43h0=; b=EUJD83169rmnizQsj4wRrK27orOsKivKNTLoIob1apPxBeKEkwNJ8yp1kY5zOGBlIb zgVirWkyqO/x0Ohit/ro6yQHgNeDnJ81I4BUiA0lkojTA/bRFoJlMI4IB2oQOM6E8qAM kCCZIW1Dc4XO/fZs/ANUqPXfwoC8jFyvSUmOizK3MAajDIS6EkqgvZvCaazv60MNpbdC yDF0RCq5BNHsXnALm+40AQylIUYkotYGhLonq7GjgPi7wvZQZrPkCFWmyMk63mncu80+ KJErULS+9QradN6nUtIg0pS/xC8DCxY8UNRLWryn8mR8RfA88hQ0E7doQ+rC079yOhOz s8rQ== X-Gm-Message-State: AOAM530U3+e5K3la5yPc1gbF0Zk/LIIG3DZmoSjLWVFbmGc6Sjp9I+A7 8bSbwJIiQIKaVQD7nDuZPONJVS5w2FU= X-Received: by 2002:ad4:504a:: with SMTP id m10mr55427983qvq.172.1594389119450; Fri, 10 Jul 2020 06:51:59 -0700 (PDT) Received: from pop-os.fios-router.home (pool-71-255-246-27.washdc.fios.verizon.net. [71.255.246.27]) by smtp.googlemail.com with ESMTPSA id h197sm7574059qke.51.2020.07.10.06.51.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2020 06:51:58 -0700 (PDT) From: Thara Gopinath To: daniel.lezcano@linaro.org, rui.zhang@intel.com, robh+dt@kernel.org Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 3/4] thermal:core:Add genetlink notifications for monitoring falling temperature Date: Fri, 10 Jul 2020 09:51:53 -0400 Message-Id: <20200710135154.181454-4-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200710135154.181454-1-thara.gopinath@linaro.org> References: <20200710135154.181454-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Add notification calls for trip type THERMAL_TRIP_COLD when temperature crosses the trip point in either direction. Signed-off-by: Thara Gopinath --- drivers/thermal/thermal_core.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) -- 2.25.1 diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 750a89f0c20a..e2302ca1cd3b 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -429,12 +429,21 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip) tz->ops->get_trip_hyst(tz, trip, &hyst); if (tz->last_temperature != THERMAL_TEMP_INVALID) { - if (tz->last_temperature < trip_temp && - tz->temperature >= trip_temp) - thermal_notify_tz_trip_up(tz->id, trip); - if (tz->last_temperature >= trip_temp && - tz->temperature < (trip_temp - hyst)) - thermal_notify_tz_trip_down(tz->id, trip); + if (type == THERMAL_TRIP_COLD) { + if (tz->last_temperature > trip_temp && + tz->temperature <= trip_temp) + thermal_notify_tz_trip_down(tz->id, trip); + if (tz->last_temperature <= trip_temp && + tz->temperature > (trip_temp + hyst)) + thermal_notify_tz_trip_up(tz->id, trip); + } else { + if (tz->last_temperature < trip_temp && + tz->temperature >= trip_temp) + thermal_notify_tz_trip_up(tz->id, trip); + if (tz->last_temperature >= trip_temp && + tz->temperature < (trip_temp - hyst)) + thermal_notify_tz_trip_down(tz->id, trip); + } } if (type == THERMAL_TRIP_CRITICAL || type == THERMAL_TRIP_HOT) From patchwork Fri Jul 10 13:51:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 235238 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp474583ilg; Fri, 10 Jul 2020 06:52:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDmF1onUrp0tRRRlyh4Py3v8AjDdS8wFxnzl/Ny/CtfezfaVdJGB1SWA23B+zEICUnPTOR X-Received: by 2002:a50:ec93:: with SMTP id e19mr49624600edr.254.1594389129742; Fri, 10 Jul 2020 06:52:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594389129; cv=none; d=google.com; s=arc-20160816; b=jEbIrYG7RPmtguqsejmsp139S/2eVkv64o1r/DfGHAxv92OOJAeJ+FwCP/sdbejCdM IvmpeLN3z9BuH/bmG0P75Bdm36xO7WtFUBmJ7GWYiFlR7ywMg+g1uHUGagURF9w2RSrO uKUqizMkA8pQbxagJlQKQ91IpsA3WPTYnprgrr2yudrLFxEGXWLtn14NBb3fI9DaP+W1 zyFfs25ldNHenfxU1470Rt1pcM0zENw7F+h9BVb13NCbKusR+vWIKUCUg7QQSyGkg0tk tV11uJLKZH9GJL+6iTeaOItvV6b7ysfRjdRpX4jWAKuRD8njh/TGyKsrUQEdv1xzUpKQ HAuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jHIyzQC2ceqyL76cAxetV2VUM/9zPrieydXeUmPcEI8=; b=SqCGDNGXzNDj22mIF7Vy/qwMJaVVJz+NutlYxu+p8SM1+GN7Ix96YGTK2XIdXFSgWr 4v/Rhlhxv2dpzJtnqDVkh5Pkme7QQhRukDqJto2xe9rylnoK4DhCp6bIBR3Id1LQ2bAc xvQX64ltCxCeRnsaMz+bHDLvfdU4YPObkIU5Aapmh93No4aWCo6gs+NWwclYJGxdWUwg /8nq0a33VXkZzcJ9S5zWtc7SFwiopA0z6kGc+ObrTbc7TsZ0EvBNIQAFaQDeLK7ng8R4 L1xulOu1mfzqgLMEdZJOftzW3vrIUxdbKz2So+DHLbOEN6Ojj8dPvujpZCB+V+1c0+YB p+Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X+s9k0k6; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu2si4562216edb.423.2020.07.10.06.52.09; Fri, 10 Jul 2020 06:52:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X+s9k0k6; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728186AbgGJNwC (ORCPT + 10 others); Fri, 10 Jul 2020 09:52:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728179AbgGJNwB (ORCPT ); Fri, 10 Jul 2020 09:52:01 -0400 Received: from mail-qv1-xf43.google.com (mail-qv1-xf43.google.com [IPv6:2607:f8b0:4864:20::f43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F453C08C5DD for ; Fri, 10 Jul 2020 06:52:01 -0700 (PDT) Received: by mail-qv1-xf43.google.com with SMTP id dm12so2558935qvb.9 for ; Fri, 10 Jul 2020 06:52:01 -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 :mime-version:content-transfer-encoding; bh=jHIyzQC2ceqyL76cAxetV2VUM/9zPrieydXeUmPcEI8=; b=X+s9k0k68ktP2Yeh15hRqVvjhNy41w6Uzqg0Vk7k9inbT3pjbSWQdujNRt+liki46B FhIFz7QnKATwGL0EUwYendyIQozMppEvO0lv5zZ8HNsCgNbx+U+L0+zu2QX4C1I1E/T4 gWA5OsfL9+hh3KM5yFCGZZwdc9ddst3WpMG8BalN1+fQVC3B2NHsxl6kcmJ2dvKLp7lU RNlnDAYvHYmU5HDdr2ey81GCD8Q7IWO7qsApfKGadFssKOiT9hAhE+8ifWvyqEzDMNc/ 1txVL72Garh01uxaM/fVsIqoMP4d7V2DC4snZ1j09TUu7dv99ln0REkoCEeoQgAiPdzE KerA== 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:mime-version:content-transfer-encoding; bh=jHIyzQC2ceqyL76cAxetV2VUM/9zPrieydXeUmPcEI8=; b=qe+G+a552P6kBbUJ8gWJjneW3iAgVsp/V4Lqvg39QZTxk+vGgDWSk4ouqskjMPopMD IpWGDmdGEx9ygqr7/aS8lKUXpzsVtPVZ0nzhkf29CNm7oX6ZfeB60G/lKLnG3dWpIMC9 54+rQYm9rkvDK2XlXjbj4Sc7FOJqzEOVGIEuapm+6Tasemtm4UgEAssSrIgpyWARQQlE MFQlPj5vnBHwZl+Zg/Ek6kirfEEQDZkgAvOUFAt1hkVF07sYHIRbU89qsK7+/JyIKKaF YRUB0r2k4PpKTEyKJQs/VIf9f2vPtRUO/xRDlWB6YawcXefLkO9IUTO0/vhIJbXyY5ll ictA== X-Gm-Message-State: AOAM530/kb7swU9X/TK6OBPM3pCwC7w3S8E3o3OoQcw/YxQR9TbHTDMV E/0TolJo77M1uctiyD+dt9UOLQ== X-Received: by 2002:a0c:b791:: with SMTP id l17mr69514906qve.44.1594389120284; Fri, 10 Jul 2020 06:52:00 -0700 (PDT) Received: from pop-os.fios-router.home (pool-71-255-246-27.washdc.fios.verizon.net. [71.255.246.27]) by smtp.googlemail.com with ESMTPSA id h197sm7574059qke.51.2020.07.10.06.51.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2020 06:51:59 -0700 (PDT) From: Thara Gopinath To: daniel.lezcano@linaro.org, rui.zhang@intel.com, robh+dt@kernel.org Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 4/4] thermal: Modify thermal governors to do nothing for "cold" trip points Date: Fri, 10 Jul 2020 09:51:54 -0400 Message-Id: <20200710135154.181454-5-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200710135154.181454-1-thara.gopinath@linaro.org> References: <20200710135154.181454-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org For now, thermal governors do not support monitoring of falling temperature. Hence, in case of calls to the governor for trip points marked as cold, return doing nothing. Signed-off-by: Thara Gopinath --- drivers/thermal/gov_bang_bang.c | 8 ++++++++ drivers/thermal/gov_fair_share.c | 8 ++++++++ drivers/thermal/gov_power_allocator.c | 8 ++++++++ drivers/thermal/gov_step_wise.c | 8 ++++++++ 4 files changed, 32 insertions(+) -- 2.25.1 diff --git a/drivers/thermal/gov_bang_bang.c b/drivers/thermal/gov_bang_bang.c index 991a1c54296d..8324d13de1e7 100644 --- a/drivers/thermal/gov_bang_bang.c +++ b/drivers/thermal/gov_bang_bang.c @@ -99,6 +99,14 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip) static int bang_bang_control(struct thermal_zone_device *tz, int trip) { struct thermal_instance *instance; + enum thermal_trip_type trip_type; + + /* Return doing nothing in case of cold trip point */ + if (trip != THERMAL_TRIPS_NONE) { + tz->ops->get_trip_type(tz, trip, &trip_type); + if (trip_type == THERMAL_TRIP_COLD) + return 0; + } thermal_zone_trip_update(tz, trip); diff --git a/drivers/thermal/gov_fair_share.c b/drivers/thermal/gov_fair_share.c index aaa07180ab48..c0adce525faa 100644 --- a/drivers/thermal/gov_fair_share.c +++ b/drivers/thermal/gov_fair_share.c @@ -81,6 +81,14 @@ static int fair_share_throttle(struct thermal_zone_device *tz, int trip) int total_weight = 0; int total_instance = 0; int cur_trip_level = get_trip_level(tz); + enum thermal_trip_type trip_type; + + /* Return doing nothing in case of cold trip point */ + if (trip != THERMAL_TRIPS_NONE) { + tz->ops->get_trip_type(tz, trip, &trip_type); + if (trip_type == THERMAL_TRIP_COLD) + return 0; + } list_for_each_entry(instance, &tz->thermal_instances, tz_node) { if (instance->trip != trip) diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c index 44636475b2a3..2644ad4d4032 100644 --- a/drivers/thermal/gov_power_allocator.c +++ b/drivers/thermal/gov_power_allocator.c @@ -613,8 +613,16 @@ static int power_allocator_throttle(struct thermal_zone_device *tz, int trip) { int ret; int switch_on_temp, control_temp; + enum thermal_trip_type trip_type; struct power_allocator_params *params = tz->governor_data; + /* Return doing nothing in case of cold trip point */ + if (trip != THERMAL_TRIPS_NONE) { + tz->ops->get_trip_type(tz, trip, &trip_type); + if (trip_type == THERMAL_TRIP_COLD) + return 0; + } + /* * We get called for every trip point but we only need to do * our calculations once diff --git a/drivers/thermal/gov_step_wise.c b/drivers/thermal/gov_step_wise.c index 2ae7198d3067..009aefda0441 100644 --- a/drivers/thermal/gov_step_wise.c +++ b/drivers/thermal/gov_step_wise.c @@ -186,6 +186,14 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip) static int step_wise_throttle(struct thermal_zone_device *tz, int trip) { struct thermal_instance *instance; + enum thermal_trip_type trip_type; + + /* For now, return doing nothing in case of cold trip point */ + if (trip != THERMAL_TRIPS_NONE) { + tz->ops->get_trip_type(tz, trip, &trip_type); + if (trip_type == THERMAL_TRIP_COLD) + return 0; + } thermal_zone_trip_update(tz, trip);