linux-mediatek.lists.infradead.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: Mark Rutland, devicetree, linux-kernel, Michael Kao,
	Eduardo Valentin, Rob Herring, linux-mediatek, hsinyi,
	Matthias Brugger, linux-arm-kernel

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
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH] [v2] thermal: core: add upper and lower limits to power_actor_set_power
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Lukasz Luba @ 2020-10-07 10:55 UTC (permalink / raw)
  To: Michael Kao, Zhang Rui, Daniel Lezcano, linux-pm, srv_heupstream
  Cc: Mark Rutland, devicetree, linux-kernel, Eduardo Valentin,
	Rob Herring, linux-mediatek, hsinyi, Matthias Brugger,
	linux-arm-kernel


On 10/7/20 3:43 AM, Michael Kao wrote:
> 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);
> 

Please check the patch with scripts/checkpatch.pl before sending.
It's again base64 encoded, I was able to apply it on my end with
--ignore-whitespace, but still some odd char is there.

If Daniel is OK to fix it when applying to the thermal branch, then:

Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Tested-by: Lukasz Luba <lukasz.luba@arm.com>

I would send a few patches on top of this one, to fully support the
upper and lower limits in IPA.

Regards,
Lukasz

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[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).