mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Baskaran Kannan <Baski.Kannan@amd.com>
Cc: babu.moger@amd.com, clemens@ladisch.de, jdelvare@suse.com,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwmon: (k10temp) Report negative temperatures
Date: Thu, 8 Jun 2023 06:51:51 -0700	[thread overview]
Message-ID: <64e6164a-c874-403e-b899-45f741db2130@roeck-us.net> (raw)
In-Reply-To: <68c53a76-efd5-42da-af98-442bd80c7300@roeck-us.net>

On Tue, May 23, 2023 at 02:46:46PM -0700, Guenter Roeck wrote:
> On Tue, May 23, 2023 at 03:49:32PM -0500, Baskaran Kannan wrote:
> > 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.
> 
> This was introduced with commit aef17ca12719 ("hwmon: (k10temp) Only apply
> temperature offset if result is positive"). This patch would effecively
> revert that change. Given the reason for introducing it I am not convinced
> that it is a good idea to unconditionally revert it.
> 

Any comments ? I am not inclined to accept this patch as-is. What are
the industrial processors ? Is there a means to detect them ?

Guenter

> Guenter
> 
> > 
> > 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-06-08 13:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-23 20:49 Baskaran Kannan
2023-05-23 21:46 ` Guenter Roeck
2023-06-08 13:51   ` Guenter Roeck [this message]
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=64e6164a-c874-403e-b899-45f741db2130@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=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 \
    /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®