stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "hwmon: (k10temp) Only apply temperature offset if result is positive" has been added to the 4.15-stable tree
@ 2018-03-27  7:32 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2018-03-27  7:32 UTC (permalink / raw)
  To: linux, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    hwmon: (k10temp) Only apply temperature offset if result is positive

to the 4.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     hwmon-k10temp-only-apply-temperature-offset-if-result-is-positive.patch
and it can be found in the queue-4.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From aef17ca1271948ee57cc39b2493d31110cc42625 Mon Sep 17 00:00:00 2001
From: Guenter Roeck <linux@roeck-us.net>
Date: Wed, 7 Feb 2018 17:49:39 -0800
Subject: hwmon: (k10temp) Only apply temperature offset if result is positive
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

From: Guenter Roeck <linux@roeck-us.net>

commit aef17ca1271948ee57cc39b2493d31110cc42625 upstream.

A user reports a really bad temperature on Ryzen 1950X.

k10temp-pci-00cb
Adapter: PCI adapter
temp1: +4294948.3°C (high = +70.0°C)

This will happen if the temperature reported by the chip is lower than
the offset temperature. This has been seen in the field if "Sense MI Skew"
and/or "Sense MI Offset" BIOS parameters were set to unexpected values.
Let's report a temperature of 0 degrees C in that case.

Fixes: 1b50b776355f ("hwmon: (k10temp) Add support for temperature offsets")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/hwmon/k10temp.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/drivers/hwmon/k10temp.c
+++ b/drivers/hwmon/k10temp.c
@@ -128,7 +128,10 @@ static ssize_t temp1_input_show(struct d
 
 	data->read_tempreg(data->pdev, &regval);
 	temp = (regval >> 21) * 125;
-	temp -= data->temp_offset;
+	if (temp > data->temp_offset)
+		temp -= data->temp_offset;
+	else
+		temp = 0;
 
 	return sprintf(buf, "%u\n", temp);
 }


Patches currently in stable-queue which might be from linux@roeck-us.net are

queue-4.15/hwmon-k10temp-add-temperature-offset-for-ryzen-1900x.patch
queue-4.15/hwmon-k10temp-only-apply-temperature-offset-if-result-is-positive.patch
queue-4.15/acpi-watchdog-fix-off-by-one-error-at-resource-assignment.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-03-27  7:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-27  7:32 Patch "hwmon: (k10temp) Only apply temperature offset if result is positive" has been added to the 4.15-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).