Commit b21defcb authored by Linus Torvalds's avatar Linus Torvalds

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
parents 2e69af16 6f824c9f
...@@ -662,14 +662,15 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz, ...@@ -662,14 +662,15 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz,
{ {
int result; int result;
tz->thermal_zone = thermal_zone_device_register_with_trips("acpitz", if (trip_count)
trip_table, tz->thermal_zone = thermal_zone_device_register_with_trips(
trip_count, "acpitz", trip_table, trip_count, tz,
tz, &acpi_thermal_zone_ops, NULL, passive_delay,
&acpi_thermal_zone_ops, tz->polling_frequency * 100);
NULL, else
passive_delay, tz->thermal_zone = thermal_tripless_zone_device_register(
tz->polling_frequency * 100); "acpitz", tz, &acpi_thermal_zone_ops, NULL);
if (IS_ERR(tz->thermal_zone)) if (IS_ERR(tz->thermal_zone))
return PTR_ERR(tz->thermal_zone); return PTR_ERR(tz->thermal_zone);
...@@ -901,11 +902,8 @@ static int acpi_thermal_add(struct acpi_device *device) ...@@ -901,11 +902,8 @@ static int acpi_thermal_add(struct acpi_device *device)
trip++; trip++;
} }
if (trip == trip_table) { if (trip == trip_table)
pr_warn(FW_BUG "No valid trip points!\n"); pr_warn(FW_BUG "No valid trip points!\n");
result = -ENODEV;
goto free_memory;
}
result = acpi_thermal_register_thermal_zone(tz, trip_table, result = acpi_thermal_register_thermal_zone(tz, trip_table,
trip - trip_table, trip - trip_table,
......
...@@ -606,7 +606,7 @@ static int allocate_actors_buffer(struct power_allocator_params *params, ...@@ -606,7 +606,7 @@ static int allocate_actors_buffer(struct power_allocator_params *params,
/* There might be no cooling devices yet. */ /* There might be no cooling devices yet. */
if (!num_actors) { if (!num_actors) {
ret = -EINVAL; ret = 0;
goto clean_state; goto clean_state;
} }
...@@ -679,11 +679,6 @@ static int power_allocator_bind(struct thermal_zone_device *tz) ...@@ -679,11 +679,6 @@ static int power_allocator_bind(struct thermal_zone_device *tz)
return -ENOMEM; return -ENOMEM;
get_governor_trips(tz, params); get_governor_trips(tz, params);
if (!params->trip_max) {
dev_warn(&tz->device, "power_allocator: missing trip_max\n");
kfree(params);
return -EINVAL;
}
ret = check_power_actors(tz, params); ret = check_power_actors(tz, params);
if (ret < 0) { if (ret < 0) {
...@@ -714,9 +709,10 @@ static int power_allocator_bind(struct thermal_zone_device *tz) ...@@ -714,9 +709,10 @@ static int power_allocator_bind(struct thermal_zone_device *tz)
else else
params->sustainable_power = tz->tzp->sustainable_power; params->sustainable_power = tz->tzp->sustainable_power;
estimate_pid_constants(tz, tz->tzp->sustainable_power, if (params->trip_max)
params->trip_switch_on, estimate_pid_constants(tz, tz->tzp->sustainable_power,
params->trip_max->temperature); params->trip_switch_on,
params->trip_max->temperature);
reset_pid_controller(params); reset_pid_controller(params);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment