linux/drivers/thermal/intel
Srinivas Pandruvada 6757a7abe4 thermal: intel: int340x: Protect trip temperature from concurrent updates
Trip temperatures are read using ACPI methods and stored in the memory
during zone initializtion and when the firmware sends a notification for
change. This trip temperature is returned when the thermal core calls via
callback get_trip_temp().

But it is possible that while updating the memory copy of the trips when
the firmware sends a notification for change, thermal core is reading the
trip temperature via the callback get_trip_temp(). This may return invalid
trip temperature.

To address this add a mutex to protect the invalid temperature reads in
the callback get_trip_temp() and int340x_thermal_read_trips().

Fixes: 5fbf7f27fa ("Thermal/int340x: Add common thermal zone handler")
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: 5.0+ <stable@vger.kernel.org> # 5.0+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2023-01-24 21:28:19 +01:00
..
int340x_thermal thermal: intel: int340x: Protect trip temperature from concurrent updates 2023-01-24 21:28:19 +01:00
intel_bxt_pmic_thermal.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
intel_hfi.c thermal: intel: hfi: Remove a pointless die_id check 2022-12-02 20:47:52 +01:00
intel_hfi.h thermal: intel: hfi: Enable notification interrupt 2022-02-03 19:50:49 +01:00
intel_menlow.c ACPI: make remove callback of ACPI driver void 2022-11-23 19:11:22 +01:00
intel_pch_thermal.c intel: thermal: PCH: Drop ACPI_FADT_LOW_POWER_S0 check 2022-07-22 21:32:47 +02:00
intel_powerclamp.c thermal: intel_powerclamp: Use first online CPU as control_cpu 2022-10-15 19:33:57 +02:00
intel_quark_dts_thermal.c thermal: Rename set_mode() to change_mode() 2020-06-29 20:26:39 +02:00
intel_soc_dts_iosf.c thermal/drivers/intel/intel_soc_dts_iosf: Switch to use find_first_zero_bit() 2021-07-04 18:28:04 +02:00
intel_soc_dts_iosf.h thermal: intel: intel_soc_dts_iosf: Utilize for_each_set_clump8 macro 2019-12-04 19:44:12 -08:00
intel_soc_dts_thermal.c thermal: Convert to new X86 CPU match macros 2020-03-24 21:33:53 +01:00
intel_tcc_cooling.c thermal: intel: intel_tcc_cooling: Add TCC cooling support for RaptorLake-S 2022-11-09 14:58:02 +01:00
Kconfig thermal: intel: hfi: INTEL_HFI_THERMAL depends on NET 2022-02-10 20:58:24 +01:00
Makefile thermal: intel: hfi: Minimally initialize the Hardware Feedback Interface 2022-02-03 19:50:49 +01:00
therm_throt.c thermal: intel: Don't set HFI status bit to 1 2022-12-14 14:50:15 +01:00
thermal_interrupt.h thermal: intel: Protect clearing of thermal status bits 2022-11-23 20:09:06 +01:00
x86_pkg_temp_thermal.c thermal: intel: Protect clearing of thermal status bits 2022-11-23 20:09:06 +01:00