Skip to contentSkip to conversation

Patch "hwmon: (k10temp) Only apply temperature offset if result is positive" has been added to the 4.15-stable tree

PATCH [email protected] 1 participant 1 message Mar 27, 2018

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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 <[email protected]> know about it.

Quoted 1 line

From aef17ca1271948ee57cc39b2493d31110cc42625 Mon Sep 17 00:00:00 2001

From: Guenter Roeck <[email protected]>
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 <[email protected]>

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")
---
 drivers/hwmon/k10temp.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/hwmon/k10temp.c +4 -1
@@ -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 [email protected] 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