Skip to content

Commit da78193

Browse files
TravMuravrafaeljw
authored andcommitted
thermal: gov_power_allocator: Allow binding without trip points
IPA probe function was recently refactored to perform extra error checks and make sure the thermal zone has trip points necessary for the IPA operation. With this change, if a thermal zone is probed such that it has no trip points that IPA can use, IPA will fail and the TZ won't be created. This is the case if a platform defines a TZ without cooling devices and only with "hot"/"critical" trip points, often found on some Qualcomm devices [1]. Documentation across IPA code (notably get_governor_trips() kerneldoc) suggests that IPA is supposed to handle such TZ even if it won't actually do anything. This commit partially reverts the previous change to allow IPA to bind to such "empty" thermal zones. Fixes: e83747c ("thermal: gov_power_allocator: Set up trip points earlier") Link: arch/arm64/boot/dts/qcom/sc7180.dtsi#n4776 # [1] Signed-off-by: Nikita Travkin <[email protected]> Reviewed-by: Lukasz Luba <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 1057c4c commit da78193

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

drivers/thermal/gov_power_allocator.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -679,11 +679,6 @@ static int power_allocator_bind(struct thermal_zone_device *tz)
679679
return -ENOMEM;
680680

681681
get_governor_trips(tz, params);
682-
if (!params->trip_max) {
683-
dev_warn(&tz->device, "power_allocator: missing trip_max\n");
684-
kfree(params);
685-
return -EINVAL;
686-
}
687682

688683
ret = check_power_actors(tz, params);
689684
if (ret < 0) {
@@ -714,9 +709,10 @@ static int power_allocator_bind(struct thermal_zone_device *tz)
714709
else
715710
params->sustainable_power = tz->tzp->sustainable_power;
716711

717-
estimate_pid_constants(tz, tz->tzp->sustainable_power,
718-
params->trip_switch_on,
719-
params->trip_max->temperature);
712+
if (params->trip_max)
713+
estimate_pid_constants(tz, tz->tzp->sustainable_power,
714+
params->trip_switch_on,
715+
params->trip_max->temperature);
720716

721717
reset_pid_controller(params);
722718

0 commit comments

Comments
 (0)