OSDN Git Service

thermal: intel: int340x: Rework updating trip points
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 25 Jan 2023 14:52:25 +0000 (15:52 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 27 Jan 2023 14:11:12 +0000 (15:11 +0100)
commitb1bf9dbffc3049ca22ab36cb807b671655a936d0
treeb8a8b84c93d9ad8a60d974a37c3592b4efe3ecf2
parent97efecfdbf6fe4915e7f71603b634d5ad3f210b1
thermal: intel: int340x: Rework updating trip points

It is generally invalid to change the trip point indices after they have
been exposed via sysfs.

Moreover, the thermal objects in the ACPI namespace cannot go away and
appear on the fly.  In practice, the only thing that can happen when the
INT3403_PERF_TRIP_POINT_CHANGED notification is sent by the platform
firmware is a change of the return values of those thermal objects.

For this reason, add a special function for updating the trip point
temperatures after re-evaluating the respective ACPI thermal objects
and change int3403_notify() to invoke it instead of
int340x_thermal_read_trips() that would change the trip point indices
on errors.  Also remove the locking from the latter, because it is only
called before registering the thermal zone and it cannot race with the
zone's callbacks.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/thermal/intel/int340x_thermal/int3403_thermal.c
drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.h