From patchwork Tue Nov 24 09:36:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: thermal-bot for Julien Panis X-Patchwork-Id: 331793 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=-20.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED 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 609C3C83012 for ; Tue, 24 Nov 2020 09:36:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 23AAB20888 for ; Tue, 24 Nov 2020 09:36:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="QB5ncI//"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="JEi79KDA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731425AbgKXJgt (ORCPT ); Tue, 24 Nov 2020 04:36:49 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:41996 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731386AbgKXJgs (ORCPT ); Tue, 24 Nov 2020 04:36:48 -0500 Date: Tue, 24 Nov 2020 09:36:45 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1606210606; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gZGZw1gg8jtu7jbm4IbnFbWzEhJIDiC6FWQLQy6YKbk=; b=QB5ncI//Tzq6FJXdC6nMsaI3K2w6LLYpQUdZYraIyw1D8PefuwMMaXjdeucjyV+TLr6ChY 1k4zlzyYeCqDWRUxdicjCm2yrjD/gsKPXSKmBZ9zXLyTjoVEL2BXX9rSnj9lMTvJfUGvpR 6wddeAqNMkQcFsp+Husy2sMlewBeVO03ScDf1Wv83BG/GH4R8H3u9DZX3gF56+cGTkATkP kJjazCOxh7HMwCG3vrgJAM2oQNrho1CdlJZchNp+m4Io85HMbPC3hwNvZiZnGk6eqRNd30 wi66gtxZwoldQn0oBI/o3HUI1Xeg1s5zv/PFEZzJLBMcrkRgeVM3lTBnDjJA4A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1606210606; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gZGZw1gg8jtu7jbm4IbnFbWzEhJIDiC6FWQLQy6YKbk=; b=JEi79KDAzukOZXNGpkKzdF6ntmAK4/hPlmKyvNnLp9gOkEBNWwSExco8SVVFyr3qwjx6Oq mEfIGH0hh2BfzIAA== From: "thermal-bot for Michael Kao" Sender: tip-bot2@linutronix.de Reply-to: linux-pm@vger.kernel.org To: linux-pm@vger.kernel.org Subject: [thermal: thermal/next] thermal: core: Add upper and lower limits to power_actor_set_power Cc: Michael Kao , Lukasz Luba , Daniel Lezcano , rui.zhang@intel.com, amitk@kernel.org In-Reply-To: <20201007024332.30322-1-michael.kao@mediatek.com> References: <20201007024332.30322-1-michael.kao@mediatek.com> MIME-Version: 1.0 Message-ID: <160621060566.11115.363303793358263038.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The following commit has been merged into the thermal/next branch of thermal: Commit-ID: 4ab17ed1318609da5c36cb7e427a1d24e52a7d6f Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//4ab17ed1318609da5c36cb7e427a1d24e52a7d6f Author: Michael Kao AuthorDate: Wed, 07 Oct 2020 10:43:32 +08:00 Committer: Daniel Lezcano CommitterDate: Mon, 26 Oct 2020 19:46:35 +01:00 thermal: core: Add upper and lower limits to power_actor_set_power The upper and lower limits of thermal throttle state in the DT do not apply to the Intelligent Power Allocation (IPA) governor. Add the clamping for cooling device upper and lower limits in the power_actor_set_power() used by IPA. Signed-off-by: Michael Kao Reviewed-by: Lukasz Luba Tested-by: Lukasz Luba Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20201007024332.30322-1-michael.kao@mediatek.com --- 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 c6d74bc..2ea3633 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -672,7 +672,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);