Skip to contentSkip to conversation

thermal: intel: introduce tcc cooling driver

PATCH Applied Zhang Rui 2 participants 2 messages Apr 12, 2021 – Apr 27, 2021 Thermal

lore
Share & tools
lore

Zhang Rui

author reviewer
#0 lore raw

PATCH v3 1/1 thermal: intel: introduce tcc cooling driver

On Intel processors, the core frequency can be reduced below OS request, when the current temperature reaches the TCC (Thermal Control Circuit) activation temperature.

The default TCC activation temperature is specified by MSR_IA32_TEMPERATURE_TARGET. However, it can be adjusted by specifying an offset in degrees C, using the TCC Offset bits in the same MSR register.

This patch introduces a cooling devices driver that utilizes the TCC Offset feature. The bigger the current cooling state is, the lower the effective TCC activation temperature is, so that the processors can be throttled earlier before system critical overheats.

Note that, on different platforms, the behavior might be different on how fast the setting takes effect, and how much the CPU frequency is reduced.

This patch has been tested on a KabyLake mobile platform from me, and also on a CometLake platform from Doug.

Tested by: Doug Smythies <[email protected]>
---
V3:
Add support for CometLake platform. Add Doug' Tested-by.
V2:
Add a note in both Kconfig description and changelog, to clarify that the behavior might not be consistent cross platforms.

---
 drivers/thermal/intel/Kconfig             |  11 ++
 drivers/thermal/intel/Makefile            |   1 +
 drivers/thermal/intel/intel_tcc_cooling.c | 129 ++++++++++++++++++++++
 3 files changed, 141 insertions(+)
 create mode 100644 drivers/thermal/intel/intel_tcc_cooling.c
drivers/thermal/intel/Kconfig +11 -0
index ce4f59213c7a..e4299ca3423c 100644
@@ -79,3 +79,14 @@ config INTEL_PCH_THERMAL
 	  Enable this to support thermal reporting on certain intel PCHs.
 	  Thermal reporting device will provide temperature reading,
 	  programmable trip points and other information.
+
+config INTEL_TCC_COOLING
+	tristate "Intel TCC offset cooling Driver"
+	depends on X86
+	help
+	  Enable this to support system cooling by adjusting the effective TCC
+	  activation temperature via the TCC Offset register, which is widely
+	  supported on modern Intel platforms.
+	  Note that, on different platforms, the behavior might be different
+	  on how fast the setting takes effect, and how much the CPU frequency
+	  is reduced.
drivers/thermal/intel/Makefile +1 -0
index ff2ad30ef397..5ff2afa388f7 100644
@@ -10,4 +10,5 @@ obj-$(CONFIG_INTEL_QUARK_DTS_THERMAL)	+= intel_quark_dts_thermal.o
 obj-$(CONFIG_INT340X_THERMAL)  += int340x_thermal/
 obj-$(CONFIG_INTEL_BXT_PMIC_THERMAL) += intel_bxt_pmic_thermal.o
 obj-$(CONFIG_INTEL_PCH_THERMAL)	+= intel_pch_thermal.o
+obj-$(CONFIG_INTEL_TCC_COOLING)	+= intel_tcc_cooling.o
 obj-$(CONFIG_X86_THERMAL_VECTOR) += therm_throt.o
drivers/thermal/intel/intel_tcc_cooling.c new file +129 -0

129 lines not on this page · raw message

Signature · 1 line
2.17.1
merge bot Applied
#1 lore raw

[thermal: thermal/next] thermal/drivers/intel: Introduce tcc cooling driver

The following commit has been merged into the thermal/next branch of thermal:

The following commit has been merged into the thermal/next branch of thermal:

Commit-ID:     2eb87d75f980bcc7c2bd370661f8fcc4ec273ea5
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//2eb87d75f980bcc7c2bd370661f8fcc4ec273ea5
Author:        Zhang Rui <[email protected]>
AuthorDate:    Mon, 12 Apr 2021 20:59:01 +08:00
Committer:     Daniel Lezcano <[email protected]>
CommitterDate: Tue, 20 Apr 2021 09:18:57 +02:00

thermal/drivers/intel: Introduce tcc cooling driver

On Intel processors, the core frequency can be reduced below OS request, when the current temperature reaches the TCC (Thermal Control Circuit) activation temperature.

The default TCC activation temperature is specified by MSR_IA32_TEMPERATURE_TARGET. However, it can be adjusted by specifying an offset in degrees C, using the TCC Offset bits in the same MSR register.

This patch introduces a cooling devices driver that utilizes the TCC Offset feature. The bigger the current cooling state is, the lower the effective TCC activation temperature is, so that the processors can be throttled earlier before system critical overheats.

Note that, on different platforms, the behavior might be different on how fast the setting takes effect, and how much the CPU frequency is reduced.

This patch has been tested on a KabyLake mobile platform from me, and also on a CometLake platform from Doug.

Tested by: Doug Smythies <[email protected]>

---
 drivers/thermal/intel/Kconfig             |  11 ++-
 drivers/thermal/intel/Makefile            |   1 +-
 drivers/thermal/intel/intel_tcc_cooling.c | 129 +++++++++++++++++++++-
 3 files changed, 141 insertions(+)
 create mode 100644 drivers/thermal/intel/intel_tcc_cooling.c
drivers/thermal/intel/Kconfig +11 -0
index ce4f592..e4299ca 100644
@@ -79,3 +79,14 @@ config INTEL_PCH_THERMAL
 	  Enable this to support thermal reporting on certain intel PCHs.
 	  Thermal reporting device will provide temperature reading,
 	  programmable trip points and other information.
+
+config INTEL_TCC_COOLING
+	tristate "Intel TCC offset cooling Driver"
+	depends on X86
+	help
+	  Enable this to support system cooling by adjusting the effective TCC
+	  activation temperature via the TCC Offset register, which is widely
+	  supported on modern Intel platforms.
+	  Note that, on different platforms, the behavior might be different
+	  on how fast the setting takes effect, and how much the CPU frequency
+	  is reduced.
drivers/thermal/intel/Makefile +1 -0
index ff2ad30..5ff2afa 100644
@@ -10,4 +10,5 @@ obj-$(CONFIG_INTEL_QUARK_DTS_THERMAL)	+= intel_quark_dts_thermal.o
 obj-$(CONFIG_INT340X_THERMAL)  += int340x_thermal/
 obj-$(CONFIG_INTEL_BXT_PMIC_THERMAL) += intel_bxt_pmic_thermal.o
 obj-$(CONFIG_INTEL_PCH_THERMAL)	+= intel_pch_thermal.o
+obj-$(CONFIG_INTEL_TCC_COOLING)	+= intel_tcc_cooling.o
 obj-$(CONFIG_X86_THERMAL_VECTOR) += therm_throt.o
drivers/thermal/intel/intel_tcc_cooling.c new file +129 -0

129 lines not on this page · raw message