]> git.baikalelectronics.ru Git - kernel.git/commit
thermal/drivers/int340x/processor_thermal: Fix tcc setting
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Mon, 28 Jun 2021 21:58:03 +0000 (14:58 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jul 2021 06:53:16 +0000 (08:53 +0200)
commit4cc7c1360bf8fca196339359d47923066b666b47
tree0e17de8fe6c360801bf97032e76850e37c2f8fdf
parentffc2e1e9972f4c13a8d386213504c455d4ff963f
thermal/drivers/int340x/processor_thermal: Fix tcc setting

commit fe6a6de6692e7f7159c1ff42b07ecd737df712b4 upstream.

The following fixes are done for tcc sysfs interface:
- TCC is 6 bits only from bit 29-24
- TCC of 0 is valid
- When BIT(31) is set, this register is read only
- Check for invalid tcc value
- Error for negative values

Fixes: 7df6a8946cffc ("drivers: thermal: processor_thermal_device: Export sysfs interface for TCC offset")
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: stable@vger.kernel.org
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20210628215803.75038-1-srinivas.pandruvada@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/thermal/intel/int340x_thermal/processor_thermal_device.c