mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] hwmon: (k10temp) Report negative temperatures
@ 2023-05-23 20:49 Baskaran Kannan
  2023-05-23 21:46 ` Guenter Roeck
  0 siblings, 1 reply; 7+ messages in thread
From: Baskaran Kannan @ 2023-05-23 20:49 UTC (permalink / raw)
  To: babu.moger, baski.kannan, clemens, jdelvare, linux, linux-hwmon,
	linux-kernel

Currently, the tctl and die temperatures are rounded off to zero
if they are less than 0. There are industrial processors which work
below zero.

To display the correct temperature remove the rounding off.

Signed-off-by: Baskaran Kannan <Baski.Kannan@amd.com>
---
 drivers/hwmon/k10temp.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/hwmon/k10temp.c b/drivers/hwmon/k10temp.c
index 7b177b9fbb09..489ad0b1bc74 100644
--- a/drivers/hwmon/k10temp.c
+++ b/drivers/hwmon/k10temp.c
@@ -204,13 +204,9 @@ static int k10temp_read_temp(struct device *dev, u32 attr, int channel,
 		switch (channel) {
 		case 0:		/* Tctl */
 			*val = get_raw_temp(data);
-			if (*val < 0)
-				*val = 0;
 			break;
 		case 1:		/* Tdie */
 			*val = get_raw_temp(data) - data->temp_offset;
-			if (*val < 0)
-				*val = 0;
 			break;
 		case 2 ... 13:		/* Tccd{1-12} */
 			amd_smn_read(amd_pci_dev_to_node_id(data->pdev),
-- 
2.25.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-06-08 19:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-23 20:49 [PATCH] hwmon: (k10temp) Report negative temperatures Baskaran Kannan
2023-05-23 21:46 ` Guenter Roeck
2023-06-08 13:51   ` Guenter Roeck
2023-06-08 17:09     ` Kannan, Baski
2023-06-08 18:03       ` Guenter Roeck
2023-06-08 18:25         ` Kannan, Baski
2023-06-08 19:17           ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®