hwmon: (coretemp) Add support for dynamic tjmax
authorZhang Rui <rui.zhang@intel.com>
Sun, 13 Nov 2022 15:31:44 +0000 (23:31 +0800)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 5 Dec 2022 00:45:03 +0000 (16:45 -0800)
commitc0c67f8761cec1fe36c21d85b1a5400ea7ac30cd
treed171cebd4f9c4a95c5b89abe13a605c87b0beee3
parent2bc0e6d07ee50497043112d677fdd34327cf025c
hwmon: (coretemp) Add support for dynamic tjmax

Tjmax value retrieved from MSR_IA32_TEMPERATURE_TARGET can be changed at
runtime when the Intel SST-PP (Intel Speed Select Technology -
Performance Profile) level is changed.

Improve the code to always use updated tjmax when it can be retrieved
from MSR_IA32_TEMPERATURE_TARGET.

When tjmax can not be retrieved from MSR_IA32_TEMPERATURE_TARGET, still
follow the previous logic and always use a static tjmax value.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Link: https://lore.kernel.org/r/20221113153145.32696-3-rui.zhang@intel.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/coretemp.c