devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [v2] thermal: core: add upper and lower limits to power_actor_set_power
@ 2020-10-07  2:43 Michael Kao
  2020-10-07 10:55 ` Lukasz Luba
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Kao @ 2020-10-07  2:43 UTC (permalink / raw)
  To: Zhang Rui, Daniel Lezcano, linux-pm, srv_heupstream
  Cc: Eduardo Valentin, Rob Herring, Mark Rutland, Matthias Brugger,
	hsinyi, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek, Michael Kao

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 <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 72bf159bcecc..a260e4a575f3 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -674,7 +674,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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-07 10:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-07  2:43 [PATCH] [v2] thermal: core: add upper and lower limits to power_actor_set_power Michael Kao
2020-10-07 10:55 ` Lukasz Luba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).