[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230523204932.2679-1-Baski.Kannan@amd.com>
Date: Tue, 23 May 2023 15:49:32 -0500
From: Baskaran Kannan <Baski.Kannan@....com>
To: <babu.moger@....com>, <baski.kannan@....com>, <clemens@...isch.de>,
<jdelvare@...e.com>, <linux@...ck-us.net>,
<linux-hwmon@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] hwmon: (k10temp) Report negative temperatures
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@....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
Powered by blists - more mailing lists