Skip to content
Commit 6fc218cc authored by Ye Zhang's avatar Ye Zhang Committed by Greg Kroah-Hartman
Browse files

thermal: devfreq_cooling: Fix perf state when calculate dfc res_util

commit a26de34b upstream.

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: 615510fe

 ("thermal: devfreq_cooling: remove old power model and use EM")
Cc: 5.11+ <stable@vger.kernel.org> # 5.11+
Signed-off-by: default avatarYe Zhang <ye.zhang@rock-chips.com>
Reviewed-by: default avatarDhruva Gole <d-gole@ti.com>
Reviewed-by: default avatarLukasz Luba <lukasz.luba@arm.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 244cb820
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment