Skip to content

Commit 0fac689

Browse files
Di Shenrafaeljw
authored andcommitted
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: Di Shen <di.shen@unisoc.com> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent ccd975d commit 0fac689

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/thermal/gov_power_allocator.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,8 @@ static int power_allocator_bind(struct thermal_zone_device *tz)
711711

712712
if (!tz->tzp->sustainable_power)
713713
dev_warn(&tz->device, "power_allocator: sustainable_power will be estimated\n");
714+
else
715+
params->sustainable_power = tz->tzp->sustainable_power;
714716

715717
estimate_pid_constants(tz, tz->tzp->sustainable_power,
716718
params->trip_switch_on,

0 commit comments

Comments
 (0)