Commit 0c2ec0f1 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge branch 'acpi-thermal'

Merge ACPI thermal driver changes for 6.6-rc1:

 - Drop non-functional nocrt parameter from ACPI thermal (Mario
   Limonciello).

 - Clean up the ACPI thermal driver, rework the handling of firmware
   notifications in it and make it provide a table of generic trip point
   structures to the core during initialization (Rafael Wysocki).

* acpi-thermal:
  ACPI: thermal: Eliminate code duplication from acpi_thermal_notify()
  ACPI: thermal: Drop unnecessary thermal zone callbacks
  ACPI: thermal: Rework thermal_get_trend()
  ACPI: thermal: Use trip point table to register thermal zones
  thermal: core: Rework and rename __for_each_thermal_trip()
  ACPI: thermal: Introduce struct acpi_thermal_trip
  ACPI: thermal: Carry out trip point updates under zone lock
  ACPI: thermal: Clean up acpi_thermal_register_thermal_zone()
  thermal: core: Add priv pointer to struct thermal_trip
  thermal: core: Introduce thermal_zone_device_exec()
  thermal: core: Do not handle trip points with invalid temperature
  ACPI: thermal: Drop redundant local variable from acpi_thermal_resume()
  ACPI: thermal: Do not attach private data to ACPI handles
  ACPI: thermal: Drop enabled flag from struct acpi_thermal_active
  ACPI: thermal: Drop nocrt parameter
parents 9bd0c413 4ab4b3b1
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -6275,10 +6275,6 @@
			-1: disable all critical trip points in all thermal zones
			<degrees C>: override all critical trip points

	thermal.nocrt=	[HW,ACPI]
			Set to disable actions on ACPI thermal zone
			critical and hot trip points.

	thermal.off=	[HW,ACPI]
			1: disable ACPI thermal control

+201 −246

File changed.

Preview size limit exceeded, changes collapsed.

+21 −1
Original line number Diff line number Diff line
@@ -348,7 +348,8 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip_id)
	struct thermal_trip trip;

	/* Ignore disabled trip points */
	if (test_bit(trip_id, &tz->trips_disabled))
	if (test_bit(trip_id, &tz->trips_disabled) ||
	    trip.temperature == THERMAL_TEMP_INVALID)
		return;

	__thermal_zone_get_trip(tz, trip_id, &trip);
@@ -496,6 +497,25 @@ void thermal_zone_device_update(struct thermal_zone_device *tz,
}
EXPORT_SYMBOL_GPL(thermal_zone_device_update);

/**
 * thermal_zone_device_exec - Run a callback under the zone lock.
 * @tz: Thermal zone.
 * @cb: Callback to run.
 * @data: Data to pass to the callback.
 */
void thermal_zone_device_exec(struct thermal_zone_device *tz,
			      void (*cb)(struct thermal_zone_device *,
					 unsigned long),
			      unsigned long data)
{
	mutex_lock(&tz->lock);

	cb(tz, data);

	mutex_unlock(&tz->lock);
}
EXPORT_SYMBOL_GPL(thermal_zone_device_exec);

static void thermal_zone_device_check(struct work_struct *work)
{
	struct thermal_zone_device *tz = container_of(work, struct
+0 −4
Original line number Diff line number Diff line
@@ -54,10 +54,6 @@ int for_each_thermal_cooling_device(int (*cb)(struct thermal_cooling_device *,
int for_each_thermal_governor(int (*cb)(struct thermal_governor *, void *),
			      void *thermal_governor);

int __for_each_thermal_trip(struct thermal_zone_device *,
			    int (*cb)(struct thermal_trip *, void *),
			    void *);

struct thermal_zone_device *thermal_zone_get_by_id(int id);

struct thermal_attr {
+8 −10
Original line number Diff line number Diff line
@@ -9,28 +9,26 @@
 */
#include "thermal_core.h"

int __for_each_thermal_trip(struct thermal_zone_device *tz,
int for_each_thermal_trip(struct thermal_zone_device *tz,
			  int (*cb)(struct thermal_trip *, void *),
			  void *data)
{
	int i, ret;
	struct thermal_trip trip;

	lockdep_assert_held(&tz->lock);

	for (i = 0; i < tz->num_trips; i++) {
	if (!tz->trips)
		return -ENODATA;

		ret = __thermal_zone_get_trip(tz, i, &trip);
		if (ret)
			return ret;

		ret = cb(&trip, data);
	for (i = 0; i < tz->num_trips; i++) {
		ret = cb(&tz->trips[i], data);
		if (ret)
			return ret;
	}

	return 0;
}
EXPORT_SYMBOL_GPL(for_each_thermal_trip);

int thermal_zone_get_num_trips(struct thermal_zone_device *tz)
{
Loading