Skip to contentSkip to conversation

hwmon: (it87) Report thermal sensor type as Intel PECI if appropriate

PATCH Applied Guenter Roeck 3 participants 15 messages Oct 28, 2012 – Nov 3, 2012

Subsystems (3)
lore
Share & tools
lore

Guenter Roeck

author maintainer
#0 lore raw

PATCH 9/9 hwmon: (it87) Report thermal sensor type as Intel PECI if appropriate

IT8721 and IT8728 support Intel PECI temperature reporting. Each sensor can be programmed to display the temperature reported on the PECI interface.

If configured for Intel PECI, the driver reported the respective thermal sensor as "disabled (0)". Fix the code to correctly report it as "Intel PECI (6)".

---
Another potential candidate for -stable.

 Documentation/hwmon/it87 |    3 ++-
 drivers/hwmon/it87.c     |   18 ++++++++++++++----
 2 files changed, 16 insertions(+), 5 deletions(-)
Documentation/hwmon/it87 +2 -1
index 92ce617..3d938aea 100644
@@ -217,4 +217,5 @@ Temperature offset attributes
 The driver supports temp[1-3]_offset sysfs attributes to adjust the reported
 temperature for thermal diodes or diode connected thermal transistors.
 If a temperature sensor is configured for thermistors, the attribute values
-are ignored.
+are ignored. If the thermal sensor type is Intel PECI, the temperature offset
+must be programmed to the critical CPU temperature.
drivers/hwmon/it87.c +14 -4
index f3f3e79..f8336be 100644
@@ -237,6 +237,7 @@ struct it87_devices {
 #define	FEAT_NEWER_AUTOPWM	(1 << 1)
 #define	FEAT_OLD_AUTOPWM	(1 << 2)
 #define	FEAT_16BIT_FAN		(1 << 3)
+#define	FEAT_PECI		(1 << 4)
 
 static const struct it87_devices it87_devices[] = {
 	[it87] = {
@@ -261,11 +262,13 @@ static const struct it87_devices it87_devices[] = {
 	},
 	[it8721] = {
 		.name = "it8721",
-		.features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FAN,
+		.features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FAN
+		  | FEAT_PECI,
 	},
 	[it8728] = {
 		.name = "it8728",
-		.features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FAN,
+		.features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FAN
+		  | FEAT_PECI,
 	},
 	[it8782] = {
 		.name = "it8782",
@@ -281,6 +284,7 @@ static const struct it87_devices it87_devices[] = {
 #define has_12mv_adc(data)	((data)->features & FEAT_12MV_ADC)
 #define has_newer_autopwm(data)	((data)->features & FEAT_NEWER_AUTOPWM)
 #define has_old_autopwm(data)	((data)->features & FEAT_OLD_AUTOPWM)
+#define has_peci(data)		((data)->features & FEAT_PECI)
 
 struct it87_sio_data {
 	enum chips type;
@@ -581,6 +585,8 @@ static ssize_t show_type(struct device *dev, struct device_attribute *attr,
 	struct it87_data *data = it87_update_device(dev);
 	u8 reg = data->sensor;	    /* In case value is updated while used */
 
+	if (has_peci(data) && (reg >> 6 = nr + 1))
+		return sprintf(buf, "6\n");  /* Intel PECI */
 	if (reg & (1 << nr))
 		return sprintf(buf, "3\n");  /* thermal diode */
 	if (reg & (8 << nr))
@@ -604,13 +610,17 @@ static ssize_t set_type(struct device *dev, struct device_attribute *attr,
 	reg = it87_read_value(data, IT87_REG_TEMP_ENABLE);
 	reg &= ~(1 << nr);
 	reg &= ~(8 << nr);
+	if (has_peci(data) && (reg >> 6 = nr + 1 || val = 6))
+		reg &= 0x3f;
 	if (val = 2) {	/* backwards compatibility */
 		dev_warn(dev,
 			 "Sensor type 2 is deprecated, please use 4 instead\n");
 		val = 4;
 	}
-	/* 3 = thermal diode; 4 = thermistor; 0 = disabled */
-	if (val = 3)
+	/* 3 = thermal diode; 4 = thermistor; 6 = Intel PECI; 0 = disabled */
+	if (has_peci(data) && val = 6)
+		reg |= (nr + 1) << 6;
+	else if (val = 3)
 		reg |= 1 << nr;
 	else if (val = 4)
 		reg |= 8 << nr;
Signature · 7 lines
1.7.9.7


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#1 lore raw

Hi Guenter,

Quoted 5 lines · Guenter Roeck

IT8721 and IT8728 support Intel PECI temperature reporting. Each sensor can be programmed to display the temperature reported on the PECI interface.

If configured for Intel PECI, the driver reported the respective thermal sensor as "disabled (0)". Fix the code to correctly report it as "Intel PECI (6)".

I think the driver reported it as whatever the other configuration bits said, not necessarily zero. The configuration scheme for thermal sensor types on these chips is anything but straightforward, plus you shouldn't assume every BIOS out there is sane ;)

Anyway, good catch, I had not noticed that newer IT87xxF chips had support for PECI.

Quoted 4 lines

---
Another potential candidate for -stable.

Seems difficult with this patch at the end of the series and depending on another non-trivial patch earlier in the series. Anyway I consider this a new feature rather than a bug fix, and some more work seems to be needed (see below), so no, I don't think pushing this to stable is the right thing to do.

Quoted 10 lines
 Documentation/hwmon/it87 |    3 ++-
 drivers/hwmon/it87.c     |   18 ++++++++++++++----
 2 files changed, 16 insertions(+), 5 deletions(-)
Documentation/hwmon/it87 +0 -0
index 92ce617..3d938aea 100644

Documentation/hwmon/it87 Temperature offset attributes · line 221

Quoted 6 lines
Documentation/hwmon/it87 +2 -1
@@ -217,4 +217,5 @@ Temperature offset attributes
 The driver supports temp[1-3]_offset sysfs attributes to adjust the reported
 temperature for thermal diodes or diode connected thermal transistors.
 If a temperature sensor is configured for thermistors, the attribute values
-are ignored.
+are ignored. If the thermal sensor type is Intel PECI, the temperature offset
+must be programmed to the critical CPU temperature.

I don't quite get this part.. Who should do that, and how?

Quoted 37 lines
drivers/hwmon/it87.c +6 -2
index f3f3e79..f8336be 100644
@@ -237,6 +237,7 @@ struct it87_devices {
 #define	FEAT_NEWER_AUTOPWM	(1 << 1)
 #define	FEAT_OLD_AUTOPWM	(1 << 2)
 #define	FEAT_16BIT_FAN		(1 << 3)
+#define	FEAT_PECI		(1 << 4)
 
 static const struct it87_devices it87_devices[] = {
 	[it87] = {
@@ -261,11 +262,13 @@ static const struct it87_devices it87_devices[] = {
 	},
 	[it8721] = {
 		.name = "it8721",
-		.features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FAN,
+		.features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FAN
+		  | FEAT_PECI,
 	},
 	[it8728] = {
 		.name = "it8728",
-		.features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FAN,
+		.features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FAN
+		  | FEAT_PECI,
 	},
 	[it8782] = {
 		.name = "it8782",
@@ -281,6 +284,7 @@ static const struct it87_devices it87_devices[] = {
 #define has_12mv_adc(data)	((data)->features & FEAT_12MV_ADC)
 #define has_newer_autopwm(data)	((data)->features & FEAT_NEWER_AUTOPWM)
 #define has_old_autopwm(data)	((data)->features & FEAT_OLD_AUTOPWM)
+#define has_peci(data)		((data)->features & FEAT_PECI)
 
 struct it87_sio_data {
 	enum chips type;

drivers/hwmon/it87.c static ssize_t show_type(struct device *dev, struct device_attribute *attr, · line 589

Quoted 5 lines
drivers/hwmon/it87.c +2 -0
@@ -581,6 +585,8 @@ static ssize_t show_type(struct device *dev, struct device_attribute *attr,
 	struct it87_data *data = it87_update_device(dev);
 	u8 reg = data->sensor;	    /* In case value is updated while used */
 
+	if (has_peci(data) && (reg >> 6 = nr + 1))
+		return sprintf(buf, "6\n");  /* Intel PECI */

Looks fine for the IT8728F, but not for the IT8721F.

For the IT8721F, the code above works fine for temp1 and temp3, but as I understand the datasheet, value 2 isn't possible and the PECI flag for temp2 would be bit 7 in register 0x55. On that chip, the CPU PECI temperature can only be mapped to temp1 and temp3 and the south bridge (PCH) PECI temperature can only be mapped to temp2.

Speaking of PCH PECI temperature, apparently the IT8728F can do this too, but differently. Relevant register is 0x9E, but to be honest I'm not sure exactly how to handle it :( I suppose we can start with only supporting the other registers for the time being, it's already better than the current situation.

Quoted 9 lines
drivers/hwmon/it87.c +2 -0
 	if (reg & (1 << nr))
 		return sprintf(buf, "3\n");  /* thermal diode */
 	if (reg & (8 << nr))
@@ -604,13 +610,17 @@ static ssize_t set_type(struct device *dev, struct device_attribute *attr,
 	reg = it87_read_value(data, IT87_REG_TEMP_ENABLE);
 	reg &= ~(1 << nr);
 	reg &= ~(8 << nr);
+	if (has_peci(data) && (reg >> 6 = nr + 1 || val = 6))
+		reg &= 0x3f;

drivers/hwmon/it87.c static ssize_t set_type(struct device *dev, struct device_attribute *attr, · line 622

Quoted 10 lines
drivers/hwmon/it87.c +3 -2
 	if (val = 2) {	/* backwards compatibility */
 		dev_warn(dev,
 			 "Sensor type 2 is deprecated, please use 4 instead\n");
 		val = 4;
 	}
-	/* 3 = thermal diode; 4 = thermistor; 0 = disabled */
-	if (val = 3)
+	/* 3 = thermal diode; 4 = thermistor; 6 = Intel PECI; 0 = disabled */
+	if (has_peci(data) && val = 6)
+		reg |= (nr + 1) << 6;

If there's no specific reason for handling this first, I'd move it last for consistency and a slightly smaller patch.

Quoted 4 lines
drivers/hwmon/it87.c +1 -0
+	else if (val = 3)
 		reg |= 1 << nr;
 	else if (val = 4)
 		reg |= 8 << nr;
Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
author maintainer
#2 lore raw
In reply to Guenter Roeck
Quoted 6 lines · Jean Delvare

Hi Guenter,

Quoted 3 lines · Guenter Roeck

IT8721 and IT8728 support Intel PECI temperature reporting. Each sensor can be programmed to display the temperature reported on the PECI interface.

Quoted 8 lines
Quoted 2 lines

If configured for Intel PECI, the driver reported the respective thermal sensor as "disabled (0)". Fix the code to correctly report it as "Intel PECI (6)".

I think the driver reported it as whatever the other configuration bits said, not necessarily zero. The configuration scheme for thermal sensor types on these chips is anything but straightforward, plus you shouldn't assume every BIOS out there is sane ;)

Good point. I'll change the text.

Quoted 3 lines

Anyway, good catch, I had not noticed that newer IT87xxF chips had support for PECI.

Me not either. See below how I found it. Interestingly, IT8782 and IT8783 don't support it (IT8772 does, though, according to coreboot).

Quoted 11 lines
Quoted 4 lines

---
Another potential candidate for -stable.

Seems difficult with this patch at the end of the series and depending on another non-trivial patch earlier in the series. Anyway I consider this a new feature rather than a bug fix, and some more work seems to be needed (see below), so no, I don't think pushing this to stable is the right thing to do.

Ok; pretty much why I didn't do it in the first place.

Quoted 5 lines
Quoted 5 lines
 Documentation/hwmon/it87 |    3 ++-
 drivers/hwmon/it87.c     |   18 ++++++++++++++----
 2 files changed, 16 insertions(+), 5 deletions(-)
Quoted 14 lines

Documentation/hwmon/it87 Temperature offset attributes · line 221

Quoted 11 lines
Documentation/hwmon/it87 +2 -1
index 92ce617..3d938aea 100644
@@ -217,4 +217,5 @@ Temperature offset attributes
 The driver supports temp[1-3]_offset sysfs attributes to adjust the reported
 temperature for thermal diodes or diode connected thermal transistors.
 If a temperature sensor is configured for thermistors, the attribute values
-are ignored.
+are ignored. If the thermal sensor type is Intel PECI, the temperature offset
+must be programmed to the critical CPU temperature.

I don't quite get this part.. Who should do that, and how?

The BIOS, presumably. It does it on my board, but wrongly. It sets it to 97 degrees C, while the CPU's Tcrit is 105 degrees C. I fixed the offset to 105, and now the reported temperature matches the CPU temperature (and moves with it). This is how I found out about PECI support in the first place.

Quoted 45 lines
Quoted 37 lines
drivers/hwmon/it87.c +6 -2
index f3f3e79..f8336be 100644
@@ -237,6 +237,7 @@ struct it87_devices {
 #define	FEAT_NEWER_AUTOPWM	(1 << 1)
 #define	FEAT_OLD_AUTOPWM	(1 << 2)
 #define	FEAT_16BIT_FAN		(1 << 3)
+#define	FEAT_PECI		(1 << 4)
 
 static const struct it87_devices it87_devices[] = {
 	[it87] = {
@@ -261,11 +262,13 @@ static const struct it87_devices it87_devices[] = {
 	},
 	[it8721] = {
 		.name = "it8721",
-		.features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FAN,
+		.features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FAN
+		  | FEAT_PECI,
 	},
 	[it8728] = {
 		.name = "it8728",
-		.features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FAN,
+		.features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FAN
+		  | FEAT_PECI,
 	},
 	[it8782] = {
 		.name = "it8782",
@@ -281,6 +284,7 @@ static const struct it87_devices it87_devices[] = {
 #define has_12mv_adc(data)	((data)->features & FEAT_12MV_ADC)
 #define has_newer_autopwm(data)	((data)->features & FEAT_NEWER_AUTOPWM)
 #define has_old_autopwm(data)	((data)->features & FEAT_OLD_AUTOPWM)
+#define has_peci(data)		((data)->features & FEAT_PECI)
 
 struct it87_sio_data {
 	enum chips type;

drivers/hwmon/it87.c static ssize_t show_type(struct device *dev, struct device_attribute *attr, · line 589

Quoted 5 lines
drivers/hwmon/it87.c +2 -0
@@ -581,6 +585,8 @@ static ssize_t show_type(struct device *dev, struct device_attribute *attr,
 	struct it87_data *data = it87_update_device(dev);
 	u8 reg = data->sensor;	    /* In case value is updated while used */
 
+	if (has_peci(data) && (reg >> 6 = nr + 1))
+		return sprintf(buf, "6\n");  /* Intel PECI */

Looks fine for the IT8728F, but not for the IT8721F.

Quoted 6 lines

For the IT8721F, the code above works fine for temp1 and temp3, but as I understand the datasheet, value 2 isn't possible and the PECI flag for temp2 would be bit 7 in register 0x55. On that chip, the CPU PECI temperature can only be mapped to temp1 and temp3 and the south bridge (PCH) PECI temperature can only be mapped to temp2.

Yes, I know, I was lazy :). I think I'll use a bitmap to handle it. Should only be releevant for writes, though.

Quoted 6 lines

Speaking of PCH PECI temperature, apparently the IT8728F can do this too, but differently. Relevant register is 0x9E, but to be honest I'm not sure exactly how to handle it :( I suppose we can start with only supporting the other registers for the time being, it's already better than the current situation.

Let me check on my board. Maybe I can get it to work; if so, I'll submit another patch to handle it.

Quoted 14 lines
Quoted 14 lines
drivers/hwmon/it87.c +2 -0
 	if (reg & (1 << nr))
 		return sprintf(buf, "3\n");  /* thermal diode */
 	if (reg & (8 << nr))
@@ -604,13 +610,17 @@ static ssize_t set_type(struct device *dev, struct device_attribute *attr,
 	reg = it87_read_value(data, IT87_REG_TEMP_ENABLE);
 	reg &= ~(1 << nr);
 	reg &= ~(8 << nr);
+	if (has_peci(data) && (reg >> 6 = nr + 1 || val = 6))
+		reg &= 0x3f;
 	if (val = 2) {	/* backwards compatibility */
 		dev_warn(dev,
 			 "Sensor type 2 is deprecated, please use 4 instead\n");
 		val = 4;
 	}
Quoted 9 lines

drivers/hwmon/it87.c static ssize_t set_type(struct device *dev, struct device_attribute *attr, · line 622

Quoted 5 lines
drivers/hwmon/it87.c +3 -2
-	/* 3 = thermal diode; 4 = thermistor; 0 = disabled */
-	if (val = 3)
+	/* 3 = thermal diode; 4 = thermistor; 6 = Intel PECI; 0 = disabled */
+	if (has_peci(data) && val = 6)
+		reg |= (nr + 1) << 6;

If there's no specific reason for handling this first, I'd move it last for consistency and a slightly smaller patch.

Ok.

Quoted 9 lines
Quoted 4 lines
drivers/hwmon/it87.c +1 -0
+	else if (val = 3)
 		reg |= 1 << nr;
 	else if (val = 4)
 		reg |= 8 << nr;
Signature · 1 line
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#3 lore raw
In reply to Guenter Roeck
Quoted 16 lines · Guenter Roeck
Quoted 14 lines · Jean Delvare

Documentation/hwmon/it87 Temperature offset attributes · line 221

Quoted 11 lines · Guenter Roeck
Documentation/hwmon/it87 +2 -1
index 92ce617..3d938aea 100644
@@ -217,4 +217,5 @@ Temperature offset attributes
 The driver supports temp[1-3]_offset sysfs attributes to adjust the reported
 temperature for thermal diodes or diode connected thermal transistors.
 If a temperature sensor is configured for thermistors, the attribute values
-are ignored.
+are ignored. If the thermal sensor type is Intel PECI, the temperature offset
+must be programmed to the critical CPU temperature.

I don't quite get this part.. Who should do that, and how?

Quoted 5 lines

The BIOS, presumably. It does it on my board, but wrongly. It sets it to 97 degrees C, while the CPU's Tcrit is 105 degrees C. I fixed the offset to 105, and now the reported temperature matches the CPU temperature (and moves with it). This is how I found out about PECI support in the first place.

In which register is the PECI temperature offset value stored? I am looking at the IT8720F datasheet and I can't find it.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
author maintainer
#4 lore raw
In reply to Guenter Roeck
Quoted 17 lines · Jean Delvare
Quoted 16 lines · Guenter Roeck
Quoted 14 lines · Jean Delvare

Documentation/hwmon/it87 Temperature offset attributes · line 221

Quoted 11 lines · Guenter Roeck
Documentation/hwmon/it87 +2 -1
index 92ce617..3d938aea 100644
@@ -217,4 +217,5 @@ Temperature offset attributes
 The driver supports temp[1-3]_offset sysfs attributes to adjust the reported
 temperature for thermal diodes or diode connected thermal transistors.
 If a temperature sensor is configured for thermistors, the attribute values
-are ignored.
+are ignored. If the thermal sensor type is Intel PECI, the temperature offset
+must be programmed to the critical CPU temperature.

I don't quite get this part.. Who should do that, and how?

Quoted 9 lines
Quoted 5 lines

The BIOS, presumably. It does it on my board, but wrongly. It sets it to 97 degrees C, while the CPU's Tcrit is 105 degrees C. I fixed the offset to 105, and now the reported temperature matches the CPU temperature (and moves with it). This is how I found out about PECI support in the first place.

In which register is the PECI temperature offset value stored? I am looking at the IT8720F datasheet and I can't find it.

On IT8728F it is in the diode zero degree adjust registers. I found this from experiments; it is not mentioned in the datasheet. I would guess it is the same on the other chips, though I can not test it on those.

Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#5 lore raw
In reply to Guenter Roeck
Quoted 8 lines · Guenter Roeck
Quoted 7 lines · Jean Delvare
Quoted 5 lines · Guenter Roeck

The BIOS, presumably. It does it on my board, but wrongly. It sets it to 97 degrees C, while the CPU's Tcrit is 105 degrees C. I fixed the offset to 105, and now the reported temperature matches the CPU temperature (and moves with it). This is how I found out about PECI support in the first place.

Quoted 7 lines
Quoted 2 lines

In which register is the PECI temperature offset value stored? I am looking at the IT8720F datasheet and I can't find it.

On IT8728F it is in the diode zero degree adjust registers. I found this from experiments; it is not mentioned in the datasheet. I would guess it is the same on the other chips, though I can not test it on those.

On an IT8720F chip with temp3 configured for PECI:

temp1_offset: 0
temp2_offset: 0
temp3_offset: -128000

I'm unsure how to interpret this -128000... This value is definitely not neutral, doesn't sound very realistic. I would expect a positive number for PECI. Maybe the offset register should be treated as unsigned in PECI mode? Or maybe its value is irrelevant for the IT8720F in PECI mode.

# grep . /sys/class/hwmon/hwmon2/device/temp3*
/sys/class/hwmon/hwmon2/device/temp3_alarm:0
/sys/class/hwmon/hwmon2/device/temp3_beep:1
/sys/class/hwmon/hwmon2/device/temp3_input:25000
/sys/class/hwmon/hwmon2/device/temp3_max:70000
/sys/class/hwmon/hwmon2/device/temp3_min:127000
/sys/class/hwmon/hwmon2/device/temp3_offset:-128000
/sys/class/hwmon/hwmon2/device/temp3_type:6

This is with an it87 driver including all your recent patches. It you have ideas or theories, I'm interested.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
author maintainer
#6 lore raw
In reply to Guenter Roeck
Quoted 38 lines · Jean Delvare
Quoted 8 lines · Guenter Roeck
Quoted 7 lines · Jean Delvare
Quoted 5 lines · Guenter Roeck

The BIOS, presumably. It does it on my board, but wrongly. It sets it to 97 degrees C, while the CPU's Tcrit is 105 degrees C. I fixed the offset to 105, and now the reported temperature matches the CPU temperature (and moves with it). This is how I found out about PECI support in the first place.

Quoted 7 lines
Quoted 2 lines

In which register is the PECI temperature offset value stored? I am looking at the IT8720F datasheet and I can't find it.

On IT8728F it is in the diode zero degree adjust registers. I found this from experiments; it is not mentioned in the datasheet. I would guess it is the same on the other chips, though I can not test it on those.

On an IT8720F chip with temp3 configured for PECI:

temp1_offset: 0
temp2_offset: 0
temp3_offset: -128000

I'm unsure how to interpret this -128000... This value is definitely not neutral, doesn't sound very realistic. I would expect a positive number for PECI. Maybe the offset register should be treated as unsigned in PECI mode? Or maybe its value is irrelevant for the IT8720F in PECI mode.

# grep . /sys/class/hwmon/hwmon2/device/temp3*
/sys/class/hwmon/hwmon2/device/temp3_alarm:0
/sys/class/hwmon/hwmon2/device/temp3_beep:1
/sys/class/hwmon/hwmon2/device/temp3_input:25000
/sys/class/hwmon/hwmon2/device/temp3_max:70000
/sys/class/hwmon/hwmon2/device/temp3_min:127000
/sys/class/hwmon/hwmon2/device/temp3_offset:-128000
/sys/class/hwmon/hwmon2/device/temp3_type:6
Quoted 3 lines

This is with an it87 driver including all your recent patches. It you have ideas or theories, I'm interested.

Hi Jean,

I agree. The alternative (+128 degrees C) sounds a bit high, though. Maybe there is another register on IT8720F to store Tjmax ? Did you check in the register map if there is a register value that happens to match it ?

What happens if you change the offset register value to, say, 100 ? Does the reported temperature change as well ?

Another maybe dumb question - is this with Intel or AMD CPU ? Because if it is AMD, it would not be PECI but AMDSI (something to fix if someone has a system w/ IT87xx and AMD CPU).

Thanks,
Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#7 lore raw
In reply to Guenter Roeck
Quoted 22 lines · Guenter Roeck
Quoted 21 lines · Jean Delvare

On an IT8720F chip with temp3 configured for PECI:

temp1_offset: 0
temp2_offset: 0
temp3_offset: -128000

I'm unsure how to interpret this -128000... This value is definitely not neutral, doesn't sound very realistic. I would expect a positive number for PECI. Maybe the offset register should be treated as unsigned in PECI mode? Or maybe its value is irrelevant for the IT8720F in PECI mode.

# grep . /sys/class/hwmon/hwmon2/device/temp3*
/sys/class/hwmon/hwmon2/device/temp3_alarm:0
/sys/class/hwmon/hwmon2/device/temp3_beep:1
/sys/class/hwmon/hwmon2/device/temp3_input:25000
/sys/class/hwmon/hwmon2/device/temp3_max:70000
/sys/class/hwmon/hwmon2/device/temp3_min:127000
/sys/class/hwmon/hwmon2/device/temp3_offset:-128000
/sys/class/hwmon/hwmon2/device/temp3_type:6
Quoted 8 lines
Quoted 3 lines

This is with an it87 driver including all your recent patches. It you have ideas or theories, I'm interested.

Hi Jean,

I agree. The alternative (+128 degrees C) sounds a bit high, though. Maybe there is another register on IT8720F to store Tjmax ? Did you check in the register map if there is a register value that happens to match it ?

How would I know which value I am looking for? k10temp says this:
high = +70.0°C, crit = +90.0°C, hyst = +87.0°C
but the monitored value doesn't match it87's temp3.

Quoted 2 lines

What happens if you change the offset register value to, say, 100 ? Does the reported temperature change as well ?

Yes it does.
temp3_offset = 120000 -> temp3_input = 14000
temp3_offset = 125000 -> temp3_input = 19000
temp3_offset = -128000 -> temp3_input = 22000
temp3_offset = -126000 -> temp3_input = 23000

This leads me to the conclusion that the offset registers are unsigned in PECI mode.

Quoted 3 lines

Another maybe dumb question - is this with Intel or AMD CPU ? Because if it is AMD, it would not be PECI but AMDSI (something to fix if someone has a system w/ IT87xx and AMD CPU).

It is AMD indeed, that's another issue I wanted to report. Do you already know how to fix it?

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
author maintainer
#8 lore raw
In reply to Guenter Roeck
Quoted 39 lines · Jean Delvare
Quoted 22 lines · Guenter Roeck
Quoted 21 lines · Jean Delvare

On an IT8720F chip with temp3 configured for PECI:

temp1_offset: 0
temp2_offset: 0
temp3_offset: -128000

I'm unsure how to interpret this -128000... This value is definitely not neutral, doesn't sound very realistic. I would expect a positive number for PECI. Maybe the offset register should be treated as unsigned in PECI mode? Or maybe its value is irrelevant for the IT8720F in PECI mode.

# grep . /sys/class/hwmon/hwmon2/device/temp3*
/sys/class/hwmon/hwmon2/device/temp3_alarm:0
/sys/class/hwmon/hwmon2/device/temp3_beep:1
/sys/class/hwmon/hwmon2/device/temp3_input:25000
/sys/class/hwmon/hwmon2/device/temp3_max:70000
/sys/class/hwmon/hwmon2/device/temp3_min:127000
/sys/class/hwmon/hwmon2/device/temp3_offset:-128000
/sys/class/hwmon/hwmon2/device/temp3_type:6
Quoted 8 lines
Quoted 3 lines

This is with an it87 driver including all your recent patches. It you have ideas or theories, I'm interested.

Hi Jean,

I agree. The alternative (+128 degrees C) sounds a bit high, though. Maybe there is another register on IT8720F to store Tjmax ? Did you check in the register map if there is a register value that happens to match it ?

How would I know which value I am looking for? k10temp says this:
high = +70.0°C, crit = +90.0°C, hyst = +87.0°C
but the monitored value doesn't match it87's temp3.

Quoted 2 lines

What happens if you change the offset register value to, say, 100 ? Does the reported temperature change as well ?

Quoted 9 lines

Yes it does.
temp3_offset = 120000 -> temp3_input = 14000
temp3_offset = 125000 -> temp3_input = 19000
temp3_offset = -128000 -> temp3_input = 22000
temp3_offset = -126000 -> temp3_input = 23000

This leads me to the conclusion that the offset registers are unsigned in PECI mode.

If so, then only for AMD, or it is is a chip dependent.

On Intel (with IT8728F):

temp3_offset = -20000: temp3_input = -96000
temp3_offset = -10000: temp3_input = -87000
temp3_offset = 0: temp3_input = -76000
temp3_offset = 10000: temp3_input = -67000
temp3_offset = 20000: temp3_input = -56000
temp3_offset = 105000: temp3_input = 28000 (matches Tjmax / coretemp)

I don't know what AMD uses as equivalent of Tjmax - maybe they use a fixed value of 128°C.

Quoted 7 lines
Quoted 3 lines

Another maybe dumb question - is this with Intel or AMD CPU ? Because if it is AMD, it would not be PECI but AMDSI (something to fix if someone has a system w/ IT87xx and AMD CPU).

It is AMD indeed, that's another issue I wanted to report. Do you already know how to fix it?

Yes, I think so, at least I have an idea. Give me a couple of days.

Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#9 lore raw
In reply to Guenter Roeck
Quoted 36 lines · Guenter Roeck
Quoted 4 lines · Jean Delvare
Quoted 3 lines · Guenter Roeck
Quoted 2 lines · Jean Delvare

On an IT8720F chip with temp3 configured for PECI:

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

temp1_offset: 0
temp2_offset: 0
temp3_offset: -128000

I'm unsure how to interpret this -128000... This value is definitely not neutral, doesn't sound very realistic. I would expect a positive number for PECI. Maybe the offset register should be treated as unsigned in PECI mode? Or maybe its value is irrelevant for the

IT8720F

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

in PECI mode.

# grep . /sys/class/hwmon/hwmon2/device/temp3*
/sys/class/hwmon/hwmon2/device/temp3_alarm:0
/sys/class/hwmon/hwmon2/device/temp3_beep:1
/sys/class/hwmon/hwmon2/device/temp3_input:25000
/sys/class/hwmon/hwmon2/device/temp3_max:70000
/sys/class/hwmon/hwmon2/device/temp3_min:127000
/sys/class/hwmon/hwmon2/device/temp3_offset:-128000
/sys/class/hwmon/hwmon2/device/temp3_type:6
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines

This is with an it87 driver including all your recent patches. It you have ideas or theories, I'm interested.

Hi Jean,

I agree. The alternative (+128 degrees C) sounds a bit high, though. Maybe there is another register on IT8720F to store Tjmax ? Did you

check

Quoted 1 line
Quoted 1 line

in the register map if there is a register value that happens to match

it ?

Quoted 1 line
Quoted 9 lines
Quoted 3 lines

How would I know which value I am looking for? k10temp says this:
high = +70.0°C, crit = +90.0°C, hyst = +87.0°C
but the monitored value doesn't match it87's temp3.

I don't know what AMD uses as equivalent of Tjmax - maybe they use a fixed value of 128°C.

Wouldn't it be 70 degC? That's the "Tcontrol" value they always reference. Anything over 70deg C on the "Tcontrol" scale is "HOT"

Phil P.

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

author maintainer
#10 lore raw
In reply to Guenter Roeck
Quoted 44 lines · Phil Pokorny
Quoted 40 lines · Guenter Roeck
Quoted 4 lines · Jean Delvare
Quoted 3 lines · Guenter Roeck
Quoted 2 lines · Jean Delvare

On an IT8720F chip with temp3 configured for PECI:

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

temp1_offset: 0
temp2_offset: 0
temp3_offset: -128000

I'm unsure how to interpret this -128000... This value is definitely not neutral, doesn't sound very realistic. I would expect a positive number for PECI. Maybe the offset register should be treated as unsigned in PECI mode? Or maybe its value is irrelevant for the

IT8720F

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

in PECI mode.

# grep . /sys/class/hwmon/hwmon2/device/temp3*
/sys/class/hwmon/hwmon2/device/temp3_alarm:0
/sys/class/hwmon/hwmon2/device/temp3_beep:1
/sys/class/hwmon/hwmon2/device/temp3_input:25000
/sys/class/hwmon/hwmon2/device/temp3_max:70000
/sys/class/hwmon/hwmon2/device/temp3_min:127000
/sys/class/hwmon/hwmon2/device/temp3_offset:-128000
/sys/class/hwmon/hwmon2/device/temp3_type:6
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines

This is with an it87 driver including all your recent patches. It you have ideas or theories, I'm interested.

Hi Jean,

I agree. The alternative (+128 degrees C) sounds a bit high, though. Maybe there is another register on IT8720F to store Tjmax ? Did you

check

Quoted 1 line
Quoted 1 line

in the register map if there is a register value that happens to match

it ?

Quoted 4 lines

How would I know which value I am looking for? k10temp says this:
high = +70.0°C, crit = +90.0°C, hyst = +87.0°C
but the monitored value doesn't match it87's temp3.

Quoted 7 lines
Quoted 3 lines

I don't know what AMD uses as equivalent of Tjmax - maybe they use a fixed value of 128°C.

Wouldn't it be 70 degC? That's the "Tcontrol" value they always reference. Anything over 70deg C on the "Tcontrol" scale is "HOT"

One would think so, but that doesn't fit with Jean's observation that he has to enter -128 degC (or possibly 128 degC) for a decent temperature reading.

Jean, does the temperature increase if you put load onto the system ? And which value in temp3_offset makes the reported temperature match the temperature reported by k10temp ?

Thanks,
Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#11 lore raw
In reply to Guenter Roeck
Quoted 4 lines · Guenter Roeck

One would think so, but that doesn't fit with Jean's observation that he has to enter -128 degC (or possibly 128 degC) for a decent temperature reading.

Jean, does the temperature increase if you put load onto the system ?

Yes.

Quoted 2 lines

And which value in temp3_offset makes the reported temperature match the temperature reported by k10temp ?

temp3_offset value of 116000 makes them match.

Thanks,

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
author maintainer
#12 lore raw
In reply to Guenter Roeck
Quoted 4 lines · Jean Delvare
Quoted 3 lines · Guenter Roeck

One would think so, but that doesn't fit with Jean's observation that he has to enter -128 degC (or possibly 128 degC) for a decent temperature reading.

Quoted 9 lines
Quoted 1 line

Jean, does the temperature increase if you put load onto the system ?

Yes.

Quoted 2 lines

And which value in temp3_offset makes the reported temperature match the temperature reported by k10temp ?

temp3_offset value of 116000 makes them match.

Good, so at least we know that we have the correct register. The only remaining question is if we should make tempX_offset unsigned if a sensor is configured for AMDTSI. Kind of odd, though, since it is signed for everything else and might thus change sign when/if the sensor type is changed. Not sure what the best approach might be.

Thanks,
Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#13 lore raw
In reply to Guenter Roeck
Quoted 8 lines · Guenter Roeck
Quoted 1 line · Jean Delvare

temp3_offset value of 116000 makes them match.

Good, so at least we know that we have the correct register. The only remaining question is if we should make tempX_offset unsigned if a sensor is configured for AMDTSI. Kind of odd, though, since it is signed for everything else and might thus change sign when/if the sensor type is changed. Not sure what the best approach might be.

Treating it as unsigned when the type is set to AMD-SI is probably the way to go for now, although I would love to get more samples from users of AMD CPUs to make sure. I suppose we'll get more feedback after the patch series you send earlier this week hits mainline.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
author maintainer
#14 lore raw
In reply to Guenter Roeck
Quoted 4 lines · Jean Delvare
Quoted 3 lines · Guenter Roeck
Quoted 1 line · Jean Delvare

temp3_offset value of 116000 makes them match.

Quoted 8 lines
Quoted 5 lines

Good, so at least we know that we have the correct register. The only remaining question is if we should make tempX_offset unsigned if a sensor is configured for AMDTSI. Kind of odd, though, since it is signed for everything else and might thus change sign when/if the sensor type is changed. Not sure what the best approach might be.

Treating it as unsigned when the type is set to AMD-SI is probably the way to go for now, although I would love to get more samples from users

Agreed.

Quoted 3 lines

of AMD CPUs to make sure. I suppose we'll get more feedback after the patch series you send earlier this week hits mainline.

and agreed.

I'll come up with one more patch to add support for AMD-SI to it8728f. Hopefully sometime this weekend.

Thanks,
Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors