thermal/drivers/intel: Introduce tcc cooling driver
authorZhang Rui <rui.zhang@intel.com>
Mon, 12 Apr 2021 12:59:01 +0000 (20:59 +0800)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Tue, 20 Apr 2021 07:18:57 +0000 (09:18 +0200)
commit2eb87d75f980bcc7c2bd370661f8fcc4ec273ea5
tree879383818d01d96dd8c42a7929663de170127594
parentd1ab7c3a33d27e7b63fd6207d88852561072ae36
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.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Tested by: Doug Smythies <dsmythies@telus.net>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20210412125901.12549-1-rui.zhang@intel.com
drivers/thermal/intel/Kconfig
drivers/thermal/intel/Makefile
drivers/thermal/intel/intel_tcc_cooling.c [new file with mode: 0644]