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

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 <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 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

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

end of thread, other threads:[~2020-10-06 14:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-24  7:16 [PATCH] thermal: power_allocate: add upper and lower limits Michael Kao
2020-04-24  9:22 ` Lukasz Luba
2020-04-29 10:39   ` Michael Kao
2020-04-29 20:24     ` Lukasz Luba
2020-08-25  9:29       ` Michael Kao
2020-10-06 14:39         ` Lukasz Luba
2020-10-06 14:46           ` 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).