Skip to content

Commit d3b60ed

Browse files
lukaszluba-armdlezcano
authored andcommitted
thermal/core/power_allocator: Maintain the device statistics from going stale
When the temperature is below the first activation trip point the cooling devices are not checked, so they cannot maintain fresh statistics. It leads into the situation, when temperature crosses first trip point, the statistics are stale and show state for very long period. This has impact on IPA algorithm calculation and wrong decisions. Thus, check the cooling devices even when the temperature is low, to refresh these statistics. Signed-off-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20210422114308.29684-3-lukasz.luba@arm.com
1 parent b70dbf4 commit d3b60ed

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

drivers/thermal/gov_power_allocator.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,15 +575,25 @@ static void allow_maximum_power(struct thermal_zone_device *tz)
575575
{
576576
struct thermal_instance *instance;
577577
struct power_allocator_params *params = tz->governor_data;
578+
u32 req_power;
578579

579580
mutex_lock(&tz->lock);
580581
list_for_each_entry(instance, &tz->thermal_instances, tz_node) {
582+
struct thermal_cooling_device *cdev = instance->cdev;
583+
581584
if ((instance->trip != params->trip_max_desired_temperature) ||
582585
(!cdev_is_power_actor(instance->cdev)))
583586
continue;
584587

585588
instance->target = 0;
586589
mutex_lock(&instance->cdev->lock);
590+
/*
591+
* Call for updating the cooling devices local stats and avoid
592+
* periods of dozen of seconds when those have not been
593+
* maintained.
594+
*/
595+
cdev->ops->get_requested_power(cdev, &req_power);
596+
587597
instance->cdev->updated = false;
588598
mutex_unlock(&instance->cdev->lock);
589599
thermal_cdev_update(instance->cdev);

0 commit comments

Comments
 (0)