mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Baskaran Kannan <Baski.Kannan@amd.com>
To: <babu.moger@amd.com>, <baski.kannan@amd.com>,
	<clemens@ladisch.de>, <jdelvare@suse.com>, <linux@roeck-us.net>,
	<linux-hwmon@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] hwmon: (k10temp) Report negative temperatures
Date: Tue, 23 May 2023 15:49:32 -0500	[thread overview]
Message-ID: <20230523204932.2679-1-Baski.Kannan@amd.com> (raw)

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


             reply	other threads:[~2023-05-23 20:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-23 20:49 Baskaran Kannan [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230523204932.2679-1-Baski.Kannan@amd.com \
    --to=baski.kannan@amd.com \
    --cc=babu.moger@amd.com \
    --cc=clemens@ladisch.de \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®