From mboxrd@z Thu Jan 1 00:00:00 1970 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.7 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, 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 19F75C55186 for ; Fri, 24 Apr 2020 07:16:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DE9542076C for ; Fri, 24 Apr 2020 07:16:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="X2OF1NZq"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="EoqGL+ku" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DE9542076C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=TZoj11wXjR22RRK4JAYCaKh94H4DYnAvxl5Cm1ewxFs=; b=X2OF1NZqxc+UjD FSQB1t9WVcnyncYwper4QJiGQsG/eWQGui3X8cy05i4lPiz/s+3N6gAXQ1T1ipJ5tM/7lWx1XD1ij JnFgqbAtme0GfCasDyESQHUszEh9rTS8Wd8aac8EL+UNCKEqDOImH4EK2du0B3L16uBTTLHqgxcsR VZDoUK8aJDANW080Bbu/QzXxhb7RfBfuyBo9JmEqLBU5awmm4SOd8ZLASfbn+pQAk74cWWIFeCEHV QwA7Vu4rFqzPfa9ocgxpq7YAAU4IecMFbhLLTLhN4EO8aWQnFLhUhY8sqNH3KWgr4QDegThqfm2AR AkgSJ/G8G6qlxBriY5Lw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jRsZO-0008Oa-Rp; Fri, 24 Apr 2020 07:16:18 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jRsZK-0008MR-F1; Fri, 24 Apr 2020 07:16:15 +0000 X-UUID: 5b4e72c253c541f6bfc593902e797f2c-20200423 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=e4Gfsp6Fj3yVSLCW8Oewrus2aSGsU6oP2lyI8Cpz4WE=; b=EoqGL+kuEKofpeohP0cMFPeCWmj64VZWeq3EdEBxm0EVGV8kpuYR7IiPz7S55b9t1Y0yNOWozKwkcTOhgCGXT33F1ipIYPxc0+Nsdq67lJ02BBepx780aTmToI/cRP+CUX+8HY1qX6FtNEZeIitGAW1fYV8vUGL+CaueswgsiDA=; X-UUID: 5b4e72c253c541f6bfc593902e797f2c-20200423 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 1643478204; Thu, 23 Apr 2020 23:15:56 -0800 Received: from mtkmbs07n1.mediatek.inc (172.21.101.16) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 24 Apr 2020 00:16:04 -0700 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 24 Apr 2020 15:16:05 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 24 Apr 2020 15:16:03 +0800 From: Michael Kao To: Zhang Rui , Eduardo Valentin , Daniel Lezcano , Rob Herring , Mark Rutland , Matthias Brugger , , , Subject: [PATCH] thermal: power_allocate: add upper and lower limits Date: Fri, 24 Apr 2020 15:16:01 +0800 Message-ID: <20200424071601.2636-1-michael.kao@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200424_001614_512963_6FA013DE X-CRM114-Status: GOOD ( 10.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Michael Kao Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org The upper and lower limits of thermal throttle state in the device tree do not apply to the power_allocate governor. Add the upper and lower limits to the power_allocate governor. Signed-off-by: Michael Kao --- drivers/thermal/thermal_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 9a321dc548c8..f6feed2265bd 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -598,7 +598,7 @@ int power_actor_set_power(struct thermal_cooling_device *cdev, if (ret) return ret; - instance->target = state; + instance->target = clamp_val(state, instance->lower, instance->upper); mutex_lock(&cdev->lock); cdev->updated = false; mutex_unlock(&cdev->lock); -- 2.18.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel