Skip to content

thermal/intel: Introduce intel-tcc lib and enhance tjmax handling

Zhang Rui linux-pm 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 1 replyIn review
  2. v16 patches 16 repliesSuperseded

Changes in v2 from the cover letter

- remove unnecessary API parameters
- avoid reading MSR on a remote CPU when possible
- coding format improvements

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6thermal/intel: Introduce Intel TCC librarydrivers/thermal/intel/Kconfig drivers/thermal/intel/Makefile drivers/thermal/intel/intel_tcc.c +1 more+162 -00 replies
2/6thermal/int340x/processor_thermal: Use Intel TCC librarydrivers/thermal/intel/int340x_thermal/Kconfig drivers/thermal/intel/int340x_thermal/processor_thermal_device.c+22 -980 replies
3/6thermal/intel/intel_soc_dts_iosf: Use Intel TCC librarydrivers/thermal/intel/Kconfig drivers/thermal/intel/intel_soc_dts_iosf.c+6 -280 replies
4/6thermal/intel/intel_tcc_cooling: Use Intel TCC librarydrivers/thermal/intel/Kconfig drivers/thermal/intel/intel_tcc_cooling.c+9 -290 replies
5/6thermal/x86_pkg_temp_thermal: Use Intel TCC librarydrivers/thermal/intel/Kconfig drivers/thermal/intel/x86_pkg_temp_thermal.c+14 -310 replies
6/6thermal/x86_pkg_temp_thermal: Add support for handling dynamic tjmaxdrivers/thermal/intel/x86_pkg_temp_thermal.c+19 -110 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH V2 0/6] thermal/intel: Introduce intel-tcc lib and enhance tjmax handling

Currently, all the thermal drivers that access the Intel CPU TCC (thermal control circuitry) MSRs have two problems,
1. they have their own implementation for the same TCC functionalities, including getting the tjmax/temperature, getting/setting the TCC offset. This introduces a lot of duplicate code.
2. they get TjMax value once and always use the cached value later. But Tjmax value retrieved from MSR_IA32_TEMPERATURE_TARGET can be changed at runtime for cases like the Intel SST-PP (Intel Speed Select Technology- Performance Profile) level change.

The intel-tcc library is introduced in patch 1/6 for cleaning up the duplicate code among these drivers, and it also ensures the temperature is alway got based on the updated tjmax value.

Patch 2 ~ 5 cleans up the drivers by using the new Intel TCC lib APIs.

Patch 6/6 enhances the x86_pkg_temp driver to handle dynamic tjmax when progamming the thermal interrupt threshold.
Actually, the thermal interrupt threshold programming can also be part of the TCC library, but I didn't do it in this version because x86_pkg_temp is the only user for now.

thanks,
rui

---
Changes since V1:
- remove unnecessary API parameters
- avoid reading MSR on a remote CPU when possible
- coding format improvements