All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukasz Luba <lukasz.luba@arm.com>
To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org
Cc: daniel.lezcano@linaro.org, amitk@kernel.org,
	Dietmar.Eggemann@arm.com, lukasz.luba@arm.com,
	michael.kao@mediatek.com, rui.zhang@intel.com
Subject: [PATCH v2 1/4] thermal: core: add upper and lower limits to power_actor_set_power
Date: Thu, 15 Oct 2020 12:24:38 +0100	[thread overview]
Message-ID: <20201015112441.4056-2-lukasz.luba@arm.com> (raw)
In-Reply-To: <20201015112441.4056-1-lukasz.luba@arm.com>

From: Michael Kao <michael.kao@mediatek.com>

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.

Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Tested-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Michael Kao <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 c6d74bc1c90b..2ea3633b5d66 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);
-- 
2.17.1


  reply	other threads:[~2020-10-15 11:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15 11:24 [PATCH v2 0/4] Add upper and lower limits in IPA power budget calculation Lukasz Luba
2020-10-15 11:24 ` Lukasz Luba [this message]
2020-10-15 11:24 ` [PATCH v2 2/4] thermal: power_allocator: respect upper and lower bounds for cooling device Lukasz Luba
2020-11-24  9:36   ` [thermal: thermal/next] thermal: power_allocator: Respect " thermal-bot for Lukasz Luba
2020-10-15 11:24 ` [PATCH v2 3/4] thermal: core: remove unused functions in power actor section Lukasz Luba
2020-11-24  9:36   ` [thermal: thermal/next] thermal: core: Remove " thermal-bot for Lukasz Luba
2020-10-15 11:24 ` [PATCH v2 4/4] thermal: move power_actor_set_power into IPA Lukasz Luba
2020-11-24  9:36   ` [thermal: thermal/next] thermal: core: Move " thermal-bot for Lukasz Luba
2020-10-26 20:42 ` [PATCH v2 0/4] Add upper and lower limits in IPA power budget calculation Daniel Lezcano
2020-11-02  9:00   ` Lukasz Luba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201015112441.4056-2-lukasz.luba@arm.com \
    --to=lukasz.luba@arm.com \
    --cc=Dietmar.Eggemann@arm.com \
    --cc=amitk@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=michael.kao@mediatek.com \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.