]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
hwmon: (k10temp) Enable AMD3255 Proc to show negative temperature
authorBaskaran Kannan <Baski.Kannan@amd.com>
Thu, 27 Jul 2023 16:21:59 +0000 (11:21 -0500)
committerRoxana Nicolescu <roxana.nicolescu@canonical.com>
Mon, 2 Oct 2023 15:20:54 +0000 (17:20 +0200)
commita599ea7d1e6914db1e00ab89e9a48ae6015f7d55
treee3a438bf9646d7488cd34e56574bf1f739adb448
parent0ccf75e7d5fe9c799ed0d114e356e10eb2a7190a
hwmon: (k10temp) Enable AMD3255 Proc to show negative temperature

BugLink: https://bugs.launchpad.net/bugs/2037005
commit e146503ac68418859fb063a3a0cd9ec93bc52238 upstream.

Industrial processor i3255 supports temperatures -40 deg celcius
to 105 deg Celcius. The current implementation of k10temp_read_temp
rounds off any negative temperatures to '0'. To fix this,
the following changes have been made.

A flag 'disp_negative' is added to struct k10temp_data to support
AMD i3255 processors. Flag 'disp_negative' is set if 3255 processor
is found during k10temp_probe.  Flag 'disp_negative' is used to
determine whether to round off negative temperatures to '0' in
k10temp_read_temp.

Signed-off-by: Baskaran Kannan <Baski.Kannan@amd.com>
Link: https://lore.kernel.org/r/20230727162159.1056136-1-Baski.Kannan@amd.com
Fixes: aef17ca12719 ("hwmon: (k10temp) Only apply temperature offset if result is positive")
Cc: stable@vger.kernel.org
[groeck: Fixed multi-line comment]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
drivers/hwmon/k10temp.c