thermal/intel: Fix intel_tcc_get_temp() to support negative CPU temperature
authorZhang Rui <rui.zhang@intel.com>
Tue, 6 Feb 2024 01:54:09 +0000 (09:54 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 12 Feb 2024 17:41:38 +0000 (18:41 +0100)
commit7251b9e8a007ddd834aa81f8c7ea338884629fec
tree074acee02e54f1b76e7ed451d30d57c1e6084402
parent841c35169323cd833294798e58b9bf63fa4fa1de
thermal/intel: Fix intel_tcc_get_temp() to support negative CPU temperature

CPU temperature can be negative in some cases. Thus the negative CPU
temperature should not be considered as a failure.

Fix intel_tcc_get_temp() and its users to support negative CPU
temperature.

Fixes: a3c1f066e1c5 ("thermal/intel: Introduce Intel TCC library")
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Cc: 6.3+ <stable@vger.kernel.org> # 6.3+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
drivers/thermal/intel/intel_tcc.c
drivers/thermal/intel/x86_pkg_temp_thermal.c
include/linux/intel_tcc.h