Skip to content

Commit b21defc

Browse files
committed
Merge tag 'thermal-6.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull thermal control fixes from Rafael Wysocki: "These fix two power allocator thermal governor issues and an ACPI thermal driver regression that all were introduced during the 6.8 development cycle. Specifics: - Allow the power allocator thermal governor to bind to a thermal zone without cooling devices and/or without trip points (Nikita Travkin) - Make the ACPI thermal driver register a tripless thermal zone when it cannot find any usable trip points instead of returning an error from acpi_thermal_add() (Stephen Horvath)" * tag 'thermal-6.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: thermal: gov_power_allocator: Allow binding without trip points thermal: gov_power_allocator: Allow binding without cooling devices ACPI: thermal: Register thermal zones without valid trip points
2 parents 2e69af1 + 6f824c9 commit b21defc

File tree

2 files changed

+15
-21
lines changed

2 files changed

+15
-21
lines changed

drivers/acpi/thermal.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -662,14 +662,15 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz,
662662
{
663663
int result;
664664

665-
tz->thermal_zone = thermal_zone_device_register_with_trips("acpitz",
666-
trip_table,
667-
trip_count,
668-
tz,
669-
&acpi_thermal_zone_ops,
670-
NULL,
671-
passive_delay,
672-
tz->polling_frequency * 100);
665+
if (trip_count)
666+
tz->thermal_zone = thermal_zone_device_register_with_trips(
667+
"acpitz", trip_table, trip_count, tz,
668+
&acpi_thermal_zone_ops, NULL, passive_delay,
669+
tz->polling_frequency * 100);
670+
else
671+
tz->thermal_zone = thermal_tripless_zone_device_register(
672+
"acpitz", tz, &acpi_thermal_zone_ops, NULL);
673+
673674
if (IS_ERR(tz->thermal_zone))
674675
return PTR_ERR(tz->thermal_zone);
675676

@@ -901,11 +902,8 @@ static int acpi_thermal_add(struct acpi_device *device)
901902
trip++;
902903
}
903904

904-
if (trip == trip_table) {
905+
if (trip == trip_table)
905906
pr_warn(FW_BUG "No valid trip points!\n");
906-
result = -ENODEV;
907-
goto free_memory;
908-
}
909907

910908
result = acpi_thermal_register_thermal_zone(tz, trip_table,
911909
trip - trip_table,

drivers/thermal/gov_power_allocator.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ static int allocate_actors_buffer(struct power_allocator_params *params,
606606

607607
/* There might be no cooling devices yet. */
608608
if (!num_actors) {
609-
ret = -EINVAL;
609+
ret = 0;
610610
goto clean_state;
611611
}
612612

@@ -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)