Skip to contentSkip to conversation

hwmon: (it87) Add support for AMDTSI, and restrict sensor type configuration

PATCH Superseded Guenter Roeck 2 participants 4 messages Nov 2, 2012 – Nov 4, 2012

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Guenter Roeck

author maintainer
#0 lore raw

PATCH 1/1 hwmon: (it87) Add support for AMDTSI, and restrict sensor type configuration

Add support to detect and report AMDTSI temperature sensor types. Only enable PECI and AMDTSI sensor selection if the chip is configured for it.

---
Applies on top of the previously submitted patches. Only tested with IT8728F and Intel CPU.

 drivers/hwmon/it87.c |   58 ++++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 52 insertions(+), 6 deletions(-)
drivers/hwmon/it87.c +51 -6
index 6a1410b..362ba60 100644
@@ -331,6 +331,7 @@ struct it87_data {
 	u16 features;
 	u8 peci_mask;
 	u8 old_peci_mask;
+	u8 ext_temp_type;	/* external temperature sensor type (5 or 6) */
 
 	unsigned short addr;
 	const char *name;
@@ -643,7 +644,7 @@ static ssize_t show_temp_type(struct device *dev, struct device_attribute *attr,
 
 	if ((has_temp_peci(data, nr) && (reg >> 6 = nr + 1))
 	    || (has_temp_old_peci(data, nr) && (extra & 0x80)))
-		return sprintf(buf, "6\n");  /* Intel PECI */
+		return sprintf(buf, "%u\n", data->ext_temp_type);
 	if (reg & (1 << nr))
 		return sprintf(buf, "3\n");  /* thermal diode */
 	if (reg & (8 << nr))
@@ -667,24 +668,26 @@ static ssize_t set_temp_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_temp_peci(data, nr) && (reg >> 6 = nr + 1 || val = 6))
+	if (has_temp_peci(data, nr) && (reg >> 6 = nr + 1 ||
+					val = data->ext_temp_type))
 		reg &= 0x3f;
 	extra = it87_read_value(data, IT87_REG_TEMP_EXTRA);
-	if (has_temp_old_peci(data, nr) && ((extra & 0x80) || val = 6))
+	if (has_temp_old_peci(data, nr) && ((extra & 0x80) ||
+					    val = data->ext_temp_type))
 		extra &= 0x7f;
 	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; 6 = Intel PECI; 0 = disabled */
+	/* 3 = thermal diode; 4 = thermistor; 5/6 = AMDTSI/PECI; 0 = disabled */
 	if (val = 3)
 		reg |= 1 << nr;
 	else if (val = 4)
 		reg |= 8 << nr;
-	else if (has_temp_peci(data, nr) && val = 6)
+	else if (has_temp_peci(data, nr) && val = data->ext_temp_type)
 		reg |= (nr + 1) << 6;
-	else if (has_temp_old_peci(data, nr) && val = 6)
+	else if (has_temp_old_peci(data, nr) && val = data->ext_temp_type)
 		extra |= 0x80;
 	else if (val != 0)
 		return -EINVAL;
@@ -1988,6 +1991,7 @@ static int __devinit it87_probe(struct platform_device *pdev)
 	int err = 0, i;
 	int enable_pwm_interface;
 	int fan_beep_need_rw;
+	u8 reg;
 
 	res = platform_get_resource(pdev, IORESOURCE_IO, 0);
 	if (!devm_request_region(&pdev->dev, res->start, IT87_EC_EXTENT,
@@ -2030,6 +2034,48 @@ static int __devinit it87_probe(struct platform_device *pdev)
 		break;
 	}
 
+	if (data->features & FEAT_TEMP_OLD_PECI) {
+		reg = it87_read_value(data, IT87_REG_VID);
+		switch ((reg >> 4) & 0x07) {
+		case 0x0:
+		default:
+			data->features &+			  ~(FEAT_TEMP_OLD_PECI | FEAT_TEMP_PECI);
+			break;
+		case 0x3:	/* PCH (IT8721F) */
+			if (data->features & FEAT_TEMP_PECI) {
+				data->features &= ~FEAT_TEMP_PECI;
+				data->ext_temp_type = 6;
+			} else {
+				data->features &= ~FEAT_TEMP_OLD_PECI;
+			}
+			break;
+		case 0x4:	/* AMDTSI */
+			data->ext_temp_type = 5;
+			break;
+		case 0x5:	/* SST slave */
+		case 0x6:	/* PECI */
+		case 0x7:	/* SST host */
+			if (data->features & FEAT_TEMP_PECI)
+				data->features &= ~FEAT_TEMP_OLD_PECI;
+			data->ext_temp_type = 6;
+			break;
+		}
+	} else if (data->features & FEAT_TEMP_PECI) {
+		/* Only support PECI for now */
+		reg = it87_read_value(data, IT87_REG_VID);
+		switch ((reg >> 4) & 0x03) {
+		case 0x0:	/* disabled */
+			data->features &= ~FEAT_TEMP_PECI;
+			break;
+		case 0x1:	/* SST slave */
+		case 0x2:	/* PECI */
+		case 0x3:	/* SST host */
+			data->ext_temp_type = 6;
+			break;
+		}
+	}
+
 	/* Now, we do the remaining detection. */
 	if ((it87_read_value(data, IT87_REG_CONFIG) & 0x80)
 	 || it87_read_value(data, IT87_REG_CHIPID) != 0x90)
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

Re: [lm-sensors] [PATCH] hwmon: (it87) Add support for AMDTSI, and restrict sensor type configuratio

Quoted 25 lines · Guenter Roeck

Add support to detect and report AMDTSI temperature sensor types. Only enable PECI and AMDTSI sensor selection if the chip is configured for it.

---
Applies on top of the previously submitted patches. Only tested with IT8728F and Intel CPU.

 drivers/hwmon/it87.c |   58 ++++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 52 insertions(+), 6 deletions(-)
drivers/hwmon/it87.c +1 -0
index 6a1410b..362ba60 100644
@@ -331,6 +331,7 @@ struct it87_data {
 	u16 features;
 	u8 peci_mask;
 	u8 old_peci_mask;
+	u8 ext_temp_type;	/* external temperature sensor type (5 or 6) */
 
 	unsigned short addr;
 	const char *name;

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

Quoted 5 lines
drivers/hwmon/it87.c +1 -1
@@ -643,7 +644,7 @@ static ssize_t show_temp_type(struct device *dev, struct device_attribute *attr,
 
 	if ((has_temp_peci(data, nr) && (reg >> 6 = nr + 1))
 	    || (has_temp_old_peci(data, nr) && (extra & 0x80)))
-		return sprintf(buf, "6\n");  /* Intel PECI */
+		return sprintf(buf, "%u\n", data->ext_temp_type);

In theory you need an explicit cast to unsigned int (or unsigned short with %hu).

Quoted 55 lines
drivers/hwmon/it87.c +16 -5
 	if (reg & (1 << nr))
 		return sprintf(buf, "3\n");  /* thermal diode */
 	if (reg & (8 << nr))
@@ -667,24 +668,26 @@ static ssize_t set_temp_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_temp_peci(data, nr) && (reg >> 6 = nr + 1 || val = 6))
+	if (has_temp_peci(data, nr) && (reg >> 6 = nr + 1 ||
+					val = data->ext_temp_type))
 		reg &= 0x3f;
 	extra = it87_read_value(data, IT87_REG_TEMP_EXTRA);
-	if (has_temp_old_peci(data, nr) && ((extra & 0x80) || val = 6))
+	if (has_temp_old_peci(data, nr) && ((extra & 0x80) ||
+					    val = data->ext_temp_type))
 		extra &= 0x7f;
 	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; 6 = Intel PECI; 0 = disabled */
+	/* 3 = thermal diode; 4 = thermistor; 5/6 = AMDTSI/PECI; 0 = disabled */
 	if (val = 3)
 		reg |= 1 << nr;
 	else if (val = 4)
 		reg |= 8 << nr;
-	else if (has_temp_peci(data, nr) && val = 6)
+	else if (has_temp_peci(data, nr) && val = data->ext_temp_type)
 		reg |= (nr + 1) << 6;
-	else if (has_temp_old_peci(data, nr) && val = 6)
+	else if (has_temp_old_peci(data, nr) && val = data->ext_temp_type)
 		extra |= 0x80;
 	else if (val != 0)
 		return -EINVAL;
@@ -1988,6 +1991,7 @@ static int __devinit it87_probe(struct platform_device *pdev)
 	int err = 0, i;
 	int enable_pwm_interface;
 	int fan_beep_need_rw;
+	u8 reg;
 
 	res = platform_get_resource(pdev, IORESOURCE_IO, 0);
 	if (!devm_request_region(&pdev->dev, res->start, IT87_EC_EXTENT,
@@ -2030,6 +2034,48 @@ static int __devinit it87_probe(struct platform_device *pdev)
 		break;
 	}
 
+	if (data->features & FEAT_TEMP_OLD_PECI) {
+		reg = it87_read_value(data, IT87_REG_VID);
+		switch ((reg >> 4) & 0x07) {
+		case 0x0:
+		default:
+			data->features &> +			  ~(FEAT_TEMP_OLD_PECI | FEAT_TEMP_PECI);
+			break;
+		case 0x3:	/* PCH (IT8721F) */

drivers/hwmon/it87.c static int __devinit it87_probe(struct platform_device *pdev) · line 2054

Quoted 10 lines
drivers/hwmon/it87.c +10 -0
+			if (data->features & FEAT_TEMP_PECI) {
+				data->features &= ~FEAT_TEMP_PECI;
+				data->ext_temp_type = 6;
+			} else {
+				data->features &= ~FEAT_TEMP_OLD_PECI;
+			}
+			break;
+		case 0x4:	/* AMDTSI */
+			data->ext_temp_type = 5;
+			break;

The IT8782 and IT8783 datasheets I have suggest that AMDTSI isn't supported on these two chips.

drivers/hwmon/it87.c static int __devinit it87_probe(struct platform_device *pdev) · line 2057

Quoted 3 lines
drivers/hwmon/it87.c +3 -0
+		case 0x5:	/* SST slave */
+		case 0x6:	/* PECI */
+		case 0x7:	/* SST host */

I am having a hard time finding information about SST. Is it a variant of PECI, an Intel-only thing? Do you have documentation?

Quoted 9 lines
drivers/hwmon/it87.c +9 -0
+			if (data->features & FEAT_TEMP_PECI)
+				data->features &= ~FEAT_TEMP_OLD_PECI;
+			data->ext_temp_type = 6;
+			break;
+		}
+	} else if (data->features & FEAT_TEMP_PECI) {
+		/* Only support PECI for now */
+		reg = it87_read_value(data, IT87_REG_VID);
+		switch ((reg >> 4) & 0x03) {

drivers/hwmon/it87.c static int __devinit it87_probe(struct platform_device *pdev) · line 2076

Quoted 10 lines
drivers/hwmon/it87.c +10 -0
+		case 0x0:	/* disabled */
+			data->features &= ~FEAT_TEMP_PECI;
+			break;
+		case 0x1:	/* SST slave */
+		case 0x2:	/* PECI */
+		case 0x3:	/* SST host */
+			data->ext_temp_type = 6;
+			break;
+		}
+	}

The more I look at the code above, the more I suspect that you should have made PCH PECI a separate feature from FEAT_TEMP_OLD_PECI. I'm sure it would make the code a lot clearer and less fragile too. Your code makes the assumption that FEAT_TEMP_PECI + FEAT_TEMP_OLD_PECI <=> FEAT_TEMP_OLD_PECI relates to PCH, which happens to be the case today but that's just a coincidence and that could change in the future. I couldn't find any bug in the code above but it took me a long time to read it, understand it and make sure it was correct. That doesn't seem right.

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

Re: [lm-sensors] [PATCH] hwmon: (it87) Add support for AMDTSI, and restrict sensor type configuratio

In reply to Guenter Roeck
Quoted 27 lines · Jean Delvare
Quoted 26 lines · Guenter Roeck

Add support to detect and report AMDTSI temperature sensor types. Only enable PECI and AMDTSI sensor selection if the chip is configured for it.

---
Applies on top of the previously submitted patches. Only tested with IT8728F and Intel CPU.

 drivers/hwmon/it87.c |   58 ++++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 52 insertions(+), 6 deletions(-)
drivers/hwmon/it87.c +1 -0
index 6a1410b..362ba60 100644
@@ -331,6 +331,7 @@ struct it87_data {
 	u16 features;
 	u8 peci_mask;
 	u8 old_peci_mask;
+	u8 ext_temp_type;	/* external temperature sensor type (5 or 6) */
 
 	unsigned short addr;
 	const char *name;
@@ -643,7 +644,7 @@ static ssize_t show_temp_type(struct device *dev, struct device_attribute *attr,
 
Quoted 8 lines

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

Quoted 4 lines
drivers/hwmon/it87.c +1 -1
 	if ((has_temp_peci(data, nr) && (reg >> 6 = nr + 1))
 	    || (has_temp_old_peci(data, nr) && (extra & 0x80)))
-		return sprintf(buf, "6\n");  /* Intel PECI */
+		return sprintf(buf, "%u\n", data->ext_temp_type);

In theory you need an explicit cast to unsigned int (or unsigned short with %hu).

Ok. Or maybe just use %d ?

Quoted 60 lines
Quoted 60 lines
drivers/hwmon/it87.c +21 -5
 	if (reg & (1 << nr))
 		return sprintf(buf, "3\n");  /* thermal diode */
 	if (reg & (8 << nr))
@@ -667,24 +668,26 @@ static ssize_t set_temp_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_temp_peci(data, nr) && (reg >> 6 = nr + 1 || val = 6))
+	if (has_temp_peci(data, nr) && (reg >> 6 = nr + 1 ||
+					val = data->ext_temp_type))
 		reg &= 0x3f;
 	extra = it87_read_value(data, IT87_REG_TEMP_EXTRA);
-	if (has_temp_old_peci(data, nr) && ((extra & 0x80) || val = 6))
+	if (has_temp_old_peci(data, nr) && ((extra & 0x80) ||
+					    val = data->ext_temp_type))
 		extra &= 0x7f;
 	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; 6 = Intel PECI; 0 = disabled */
+	/* 3 = thermal diode; 4 = thermistor; 5/6 = AMDTSI/PECI; 0 = disabled */
 	if (val = 3)
 		reg |= 1 << nr;
 	else if (val = 4)
 		reg |= 8 << nr;
-	else if (has_temp_peci(data, nr) && val = 6)
+	else if (has_temp_peci(data, nr) && val = data->ext_temp_type)
 		reg |= (nr + 1) << 6;
-	else if (has_temp_old_peci(data, nr) && val = 6)
+	else if (has_temp_old_peci(data, nr) && val = data->ext_temp_type)
 		extra |= 0x80;
 	else if (val != 0)
 		return -EINVAL;
@@ -1988,6 +1991,7 @@ static int __devinit it87_probe(struct platform_device *pdev)
 	int err = 0, i;
 	int enable_pwm_interface;
 	int fan_beep_need_rw;
+	u8 reg;
 
 	res = platform_get_resource(pdev, IORESOURCE_IO, 0);
 	if (!devm_request_region(&pdev->dev, res->start, IT87_EC_EXTENT,
@@ -2030,6 +2034,48 @@ static int __devinit it87_probe(struct platform_device *pdev)
 		break;
 	}
 
+	if (data->features & FEAT_TEMP_OLD_PECI) {
+		reg = it87_read_value(data, IT87_REG_VID);
+		switch ((reg >> 4) & 0x07) {
+		case 0x0:
+		default:
+			data->features &> > +			  ~(FEAT_TEMP_OLD_PECI | FEAT_TEMP_PECI);
+			break;
+		case 0x3:	/* PCH (IT8721F) */
+			if (data->features & FEAT_TEMP_PECI) {
+				data->features &= ~FEAT_TEMP_PECI;
+				data->ext_temp_type = 6;
+			} else {
+				data->features &= ~FEAT_TEMP_OLD_PECI;
Quoted 9 lines

drivers/hwmon/it87.c static int __devinit it87_probe(struct platform_device *pdev) · line 2054

Quoted 5 lines
drivers/hwmon/it87.c +5 -0
+			}
+			break;
+		case 0x4:	/* AMDTSI */
+			data->ext_temp_type = 5;
+			break;

The IT8782 and IT8783 datasheets I have suggest that AMDTSI isn't supported on these two chips.

Thanks for the note - I didn't notice. I'll have to think about this some more. Maybe I should introduce a separate flag for AMDTSI.

Quoted 7 lines

drivers/hwmon/it87.c static int __devinit it87_probe(struct platform_device *pdev) · line 2057

Quoted 3 lines
drivers/hwmon/it87.c +3 -0
+		case 0x5:	/* SST slave */
+		case 0x6:	/* PECI */
+		case 0x7:	/* SST host */

I am having a hard time finding information about SST. Is it a variant of PECI, an Intel-only thing? Do you have documentation?

Nothing really. The W83627UHG datasheet says it means Simple Serial Transport, which is supposed to be a replacement for SMBus. Not sure if it is really used anywhere (or what we should do if it is selected, for that matter).

Quoted 21 lines
Quoted 9 lines
drivers/hwmon/it87.c +9 -0
+			if (data->features & FEAT_TEMP_PECI)
+				data->features &= ~FEAT_TEMP_OLD_PECI;
+			data->ext_temp_type = 6;
+			break;
+		}
+	} else if (data->features & FEAT_TEMP_PECI) {
+		/* Only support PECI for now */
+		reg = it87_read_value(data, IT87_REG_VID);
+		switch ((reg >> 4) & 0x03) {

drivers/hwmon/it87.c static int __devinit it87_probe(struct platform_device *pdev) · line 2076

Quoted 10 lines
drivers/hwmon/it87.c +10 -0
+		case 0x0:	/* disabled */
+			data->features &= ~FEAT_TEMP_PECI;
+			break;
+		case 0x1:	/* SST slave */
+		case 0x2:	/* PECI */
+		case 0x3:	/* SST host */
+			data->ext_temp_type = 6;
+			break;
+		}
+	}

The more I look at the code above, the more I suspect that you should

Quoted 9 lines

have made PCH PECI a separate feature from FEAT_TEMP_OLD_PECI. I'm sure it would make the code a lot clearer and less fragile too. Your code makes the assumption that FEAT_TEMP_PECI + FEAT_TEMP_OLD_PECI <=> FEAT_TEMP_OLD_PECI relates to PCH, which happens to be the case today but that's just a coincidence and that could change in the future. I couldn't find any bug in the code above but it took me a long time to read it, understand it and make sure it was correct. That doesn't seem right.

Plus, turns out IT8728F actually has a separate register to select the target for AMDTSI/PCH :(. I'll think about it some more.

Guenter

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

#3 lore raw

Re: [lm-sensors] [PATCH] hwmon: (it87) Add support for AMDTSI, and restrict sensor type configurati

In reply to Guenter Roeck
Quoted 24 lines · Guenter Roeck
Quoted 15 lines · Jean Delvare
Quoted 14 lines · Guenter Roeck
drivers/hwmon/it87.c +1 -0
index 6a1410b..362ba60 100644
@@ -331,6 +331,7 @@ struct it87_data {
 	u16 features;
 	u8 peci_mask;
 	u8 old_peci_mask;
+	u8 ext_temp_type;	/* external temperature sensor type (5 or 6) */
 
 	unsigned short addr;
 	const char *name;
@@ -643,7 +644,7 @@ static ssize_t show_temp_type(struct device *dev, struct device_attribute *attr,
 
Quoted 7 lines

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

Quoted 4 lines
drivers/hwmon/it87.c +1 -1
 	if ((has_temp_peci(data, nr) && (reg >> 6 = nr + 1))
 	    || (has_temp_old_peci(data, nr) && (extra & 0x80)))
-		return sprintf(buf, "6\n");  /* Intel PECI */
+		return sprintf(buf, "%u\n", data->ext_temp_type);

In theory you need an explicit cast to unsigned int (or unsigned short with %hu).

Quoted 1 line

Ok. Or maybe just use %d ?

You'll need a cast with %d too. There is simply no format to print a u8.

Quoted 23 lines
Quoted 14 lines
Quoted 14 lines
drivers/hwmon/it87.c +13 -0
(...)
+	if (data->features & FEAT_TEMP_OLD_PECI) {
+		reg = it87_read_value(data, IT87_REG_VID);
+		switch ((reg >> 4) & 0x07) {
+		case 0x0:
+		default:
+			data->features &> > > +			  ~(FEAT_TEMP_OLD_PECI | FEAT_TEMP_PECI);
+			break;
+		case 0x3:	/* PCH (IT8721F) */
+			if (data->features & FEAT_TEMP_PECI) {
+				data->features &= ~FEAT_TEMP_PECI;
+				data->ext_temp_type = 6;
+			} else {
+				data->features &= ~FEAT_TEMP_OLD_PECI;
Quoted 8 lines

drivers/hwmon/it87.c static int __devinit it87_probe(struct platform_device *pdev) · line 2054

Quoted 5 lines
drivers/hwmon/it87.c +5 -0
+			}
+			break;
+		case 0x4:	/* AMDTSI */
+			data->ext_temp_type = 5;
+			break;

The IT8782 and IT8783 datasheets I have suggest that AMDTSI isn't supported on these two chips.

Quoted 2 lines

Thanks for the note - I didn't notice. I'll have to think about this some more. Maybe I should introduce a separate flag for AMDTSI.

Or do this part of the configuration based on chip type rather than feature flags. I think I would have started there (which doesn't mean it'll be better though, you won't know for sure until you try.)

Quoted 7 lines
Quoted 3 lines

(...)
I am having a hard time finding information about SST. Is it a variant of PECI, an Intel-only thing? Do you have documentation?

Nothing really. The W83627UHG datasheet says it means Simple Serial Transport, which is supposed to be a replacement for SMBus. Not sure if it is really used anywhere (or what we should do if it is selected, for that matter).

OK... I suppose it is used to let a master hardware monitoring device read from a slave hardware monitoring device so that the master can do automatic fan speed regulation based on e temperature sensor found in the slave. Counting this as PECI isn't quite right... the truth in this case is that we don't know the sensor type, other than its external nature. We should either not report a type at all (but that might make the code more complex) or add another type value for this case, like "external" or "unknown".

Quoted 11 lines
Quoted 10 lines

(...)
The more I look at the code above, the more I suspect that you should have made PCH PECI a separate feature from FEAT_TEMP_OLD_PECI. I'm sure it would make the code a lot clearer and less fragile too. Your code makes the assumption that FEAT_TEMP_PECI + FEAT_TEMP_OLD_PECI <=> FEAT_TEMP_OLD_PECI relates to PCH, which happens to be the case today but that's just a coincidence and that could change in the future. I couldn't find any bug in the code above but it took me a long time to read it, understand it and make sure it was correct. That doesn't seem right.

Quoted 2 lines

Plus, turns out IT8728F actually has a separate register to select the target for AMDTSI/PCH :(. I'll think about it some more.

OK.

Signature · 6 lines
Jean Delvare

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