thermal: power_allocator: Avoid overwriting PID coefficients from setup time
Subsystems (2)
PATCH RESEND v2 1/1 thermal: 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.
--- drivers/thermal/gov_power_allocator.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/thermal/gov_power_allocator.c +2 -0
@@ -711,6 +711,8 @@ static int power_allocator_bind(struct thermal_zone_device *tz)if (!tz->tzp->sustainable_power)dev_warn (&tz->device,"power_allocator: sustainable_power will be estimated\n" ); +else + params->sustainable_power = tz->tzp->sustainable_power; estimate_pid_constants(tz, tz->tzp->sustainable_power, params->trip_switch_on,
Signature · 1 line
2.17.1
Quoted 29 lines · Di Shen
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_powerwhen 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 thesustainable_poweris modified.Signed-off-by Di Shen <[email protected]>Reviewed-by Lukasz Luba <[email protected]>--- drivers/thermal/gov_power_allocator.c | 2 ++ 1 file changed, 2 insertions(+)drivers/thermal/gov_power_allocator.c +0
-0
drivers/thermal/gov_power_allocator.c static int power_allocator_bind(struct thermal_zone_device *tz)
Quoted 9 lines
drivers/thermal/gov_power_allocator.c +2
-1@@ -711,6 +711,8 @@ static int power_allocator_bind(struct thermal_zone_device *tz)if (!tz->tzp->sustainable_power)dev_warn (&tz->device,"power_allocator: sustainable_power will be estimated\n" ); +else + params->sustainable_power = tz->tzp->sustainable_power; estimate_pid_constants(tz, tz->tzp->sustainable_power, params->trip_switch_on, --
Applied as 6.9 material, thanks!