Commit e7c05152 authored by Di Shen's avatar Di Shen Committed by Matthias Männich
Browse files

BACKPORT: thermal: gov_power_allocator: Avoid overwriting PID coefficients from setup time



When the PID coefficients k_* are set via sysfs before the IPA
algorithm is triggered then the coefficients would be overwritten after
IPA throttle() is called. The old configuration values might be
different than the new values estimated by the IPA internal algorithm.

There might be a time delay when this overwriting happens. It
depends on the thermal zone temperature value. The temperature value
needs to cross the first trip point value then IPA algorithms start
operating. Although, the PID coefficients setup time should not be
affected or linked to any later operating phase and values must not be
overwritten.

This patch initializes params->sustainable_power when the governor
binds to thermal zone to avoid overwriting k_*. The basic function won't
be affected, as the k_* still can be estimated if the sustainable_power
is modified.

Signed-off-by: default avatarDi Shen <di.shen@unisoc.com>
Reviewed-by: default avatarLukasz Luba <lukasz.luba@arm.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>

Link: https://lore.kernel.org/all/20240207020923.4720-1-di.shen@unisoc.com/



Bug: 361236576
(cherry picked from commit 0fac6893)
[ di: Resolved minor conflict in drivers/thermal/gov_power_allocator.c ]
Change-Id: I062bcd702c353a3c48e3eca17631f472effccdd2
Signed-off-by: default avatarDi Shen <di.shen@unisoc.com>
parent bea8a4ba
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment