[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tencent_FFD1C08721AB1823AB10E04FFFD29F357C06@qq.com>
Date: Tue, 30 Dec 2025 03:19:43 -0500
From: jiping huang <huangjiping95@...com>
To: rafael@...nel.org,
daniel.lezcano@...aro.org,
rui.zhang@...el.com,
lukasz.luba@....com
Cc: linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org,
jiping huang <huangjiping95@...com>,
jiping huang <jipinghuang686@...il.com>
Subject: [PATCH] thermal: add the setting logic for cdev state while trip->threshold modified dynamically.
In the current gov algorithm, only when temperature > trip_threshold
and the temperature rising, in both cases where temperature <
trip_threshold and temperature dropping, cdev ->states will be updated.
In theory, if the trip_threshold is modified runtime and there are
still situations where the temperature remains unchanged or decreases
when the throttle is true, and where the temperature rises or remains
unchanged when the throttle is false, then the cdev ->state should be
updated by comparing temperature with the trip threshold again.
Signed-off-by: jiping huang <jipinghuang686@...il.com>
---
drivers/thermal/gov_step_wise.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/gov_step_wise.c b/drivers/thermal/gov_step_wise.c
index 65974fe8be0d..d1fe7e28297f 100644
--- a/drivers/thermal/gov_step_wise.c
+++ b/drivers/thermal/gov_step_wise.c
@@ -49,9 +49,9 @@ static unsigned long get_target_state(struct thermal_instance *instance,
}
if (throttle) {
- if (trend == THERMAL_TREND_RAISING)
+ if (trend == THERMAL_TREND_RAISING || cur_state <= instance->lower)
return clamp(cur_state + 1, instance->lower, instance->upper);
- } else if (trend == THERMAL_TREND_DROPPING) {
+ } else {
if (cur_state <= instance->lower)
return THERMAL_NO_TARGET;
--
2.34.1
Powered by blists - more mailing lists