Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit a26de34

Browse files
Ye Zhangrafaeljw
authored andcommitted
thermal: devfreq_cooling: Fix perf state when calculate dfc res_util
The issue occurs when the devfreq cooling device uses the EM power model and the get_real_power() callback is provided by the driver. The EM power table is sorted ascending,can't index the table by cooling device state,so convert cooling state to performance state by dfc->max_state - dfc->capped_state. Fixes: 615510f ("thermal: devfreq_cooling: remove old power model and use EM") Cc: 5.11+ <stable@vger.kernel.org> # 5.11+ Signed-off-by: Ye Zhang <ye.zhang@rock-chips.com> Reviewed-by: Dhruva Gole <d-gole@ti.com> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent f67cf45 commit a26de34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/thermal/devfreq_cooling.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ static int devfreq_cooling_get_requested_power(struct thermal_cooling_device *cd
214214

215215
res = dfc->power_ops->get_real_power(df, power, freq, voltage);
216216
if (!res) {
217-
state = dfc->capped_state;
217+
state = dfc->max_state - dfc->capped_state;
218218

219219
/* Convert EM power into milli-Watts first */
220220
rcu_read_lock();

0 commit comments

Comments
 (0)