Skip to contentSkip to conversation

f71882fg-* How do you set temp limits for max_hyst and

lm-sensors David C. Rankin 2 participants 5 messages Oct 20, 2008 – Oct 21, 2008

lore
Share & tools
lore
#0 lore raw

sensor Devs,

I have an MSI K9N2 SLI Platinum board that has the f71882fg- chip. I am unable
to set the tempX_max_hyst and tempX_crit_hyst temperature limits with sensors-3.0.2-4.1. Attempting to set the values results in the normal error messages on sensors -s:

Error: Line 70: Unknown feature name
Error: Line 71: Unknown feature name
f71882fg-isa-0a00: No such subfeature known

I google and found an old kernel.org message related to the data structure:

+struct f71882fg_data {
+ unsigned short addr;
+ struct class_device *class_dev;
+

+       struct mutex update_lock;
+       char valid;                     /* !=0 if following fields are valid */
+       unsigned long last_updated;     /* In jiffies */
+       unsigned long last_limits;      /* In jiffies */
+
+       /* Register Values */
+       u8      in[9];
+       u8      in1_max;
+       u8      in_status;
+       u8      in_beep;
+       u16     fan[4];
+       u8      fan_status;
+       u8      fan_beep;
+       u8      temp[3];
+       u8      temp_ovt[3];
+       u8      temp_high[3];
+       u8      temp_hyst[3];
+       u8      temp_type[3];
+       u8      temp_status;
+       u8      temp_beep;
+       u8      temp_diode_open;

+};
+
+static u8 f71882fg_read8(struct f71882fg_data *data, u8 reg); +static u16 f71882fg_read16(struct f71882fg_data *data, u8 reg); +static void f71882fg_write8(struct f71882fg_data *data, u8 reg, u8 val); +
+/* Sysfs in*/
+static ssize_t show_in(struct device *dev, struct device_attribute *devattr,
+ char *buf);
+static ssize_t show_in_max(struct device *dev, struct device_attribute
+ *devattr, char *buf);
+static ssize_t store_in_max(struct device *dev, struct device_attribute
+ *devattr, const char *buf, size_t count);
+static ssize_t show_in_beep(struct device *dev, struct device_attribute
+ *devattr, char *buf);
+static ssize_t store_in_beep(struct device *dev, struct device_attribute
+ *devattr, const char *buf, size_t count);
+static ssize_t show_in_alarm(struct device *dev, struct device_attribute
+ *devattr, char *buf);
+/* Sysfs Fan */
+static ssize_t show_fan(struct device *dev, struct device_attribute *devattr,
+ char *buf);
+static ssize_t show_fan_beep(struct device *dev, struct device_attribute
+ *devattr, char *buf);
+static ssize_t store_fan_beep(struct device *dev, struct device_attribute
+ *devattr, const char *buf, size_t count);
+static ssize_t show_fan_alarm(struct device *dev, struct device_attribute
+ *devattr, char *buf);
+/* Sysfs Temp */
+static ssize_t show_temp(struct device *dev, struct device_attribute
+ *devattr, char *buf);
+static ssize_t show_temp_max(struct device *dev, struct device_attribute
+ *devattr, char *buf);
+static ssize_t store_temp_max(struct device *dev, struct device_attribute
+ *devattr, const char *buf, size_t count);
+static ssize_t show_temp_max_hyst(struct device *dev, struct device_attribute
+ *devattr, char *buf);
+static ssize_t store_temp_max_hyst(struct device *dev, struct device_attribute
+ *devattr, const char *buf, size_t count);
+static ssize_t show_temp_crit(struct device *dev, struct device_attribute
+ *devattr, char *buf);
+static ssize_t store_temp_crit(struct device *dev, struct device_attribute
+ *devattr, const char *buf, size_t count);
+static ssize_t show_temp_crit_hyst(struct device *dev, struct device_attribute
+ *devattr, char *buf);
+static ssize_t show_temp_type(struct device *dev, struct device_attribute
+ *devattr, char *buf);
+static ssize_t show_temp_beep(struct device *dev, struct device_attribute
+ *devattr, char *buf);
+static ssize_t store_temp_beep(struct device *dev, struct device_attribute
+ *devattr, const char *buf, size_t count);
+static ssize_t show_temp_alarm(struct device *dev, struct device_attribute
+ *devattr, char *buf);
+static ssize_t show_temp_fault(struct device *dev, struct device_attribute
+ *devattr, char *buf);
+/* Sysfs misc */
+static ssize_t show_name(struct device *dev, struct device_attribute *devattr,
+ char *buf);

That suggest that I should be able to configure the limits with something like:

# Set CPU and System temp limits

set temp1_max_hyst 50
set temp1_max 55
set temp1_crit_hyst 56
set temp1_crit 60
set temp2_max_hyst 50
set temp2_max 55
set temp2_crit_hyst 56
set temp2_crit 60

However, all of the _hyst settings result in the errors explained above. So,
how do you set the hyst limits with this chipset?

If you need additional information, please just ask and I'll be glad to
provide it. Also, I tried enabling temp3 and that resulted in a wild value of 127 deg.C which is way off-scale high. Any ideas what this sensor does?

Thanks.

Signature · 8 lines
David C. Rankin, J.D., P.E.
Rankin Law Firm, PLLC
www.rankinlawfirm.com

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

Re: [lm-sensors] f71882fg-* How do you set temp limits for max_hyst

Quoted 10 lines · David C. Rankin

sensor Devs,

I have an MSI K9N2 SLI Platinum board that has the f71882fg- chip. I am unable
to set the tempX_max_hyst and tempX_crit_hyst temperature limits with sensors-3.0.2-4.1. Attempting to set the values results in the normal error messages on sensors -s:

Error: Line 70: Unknown feature name
Error: Line 71: Unknown feature name

<snip>

Quoted 9 lines

set temp1_max_hyst 50
set temp1_max 55
set temp1_crit_hyst 56
set temp1_crit 60
set temp2_max_hyst 50
set temp2_max 55
set temp2_crit_hyst 56
set temp2_crit 60

Quoted 3 lines

However, all of the _hyst settings result in the errors explained above. So,
how do you set the hyst limits with this chipset?

Erm, that should work. What does ls /sys/class/hwmon/hwmon*/device show ?

If there are temp#_max_hyst files there try:
echo -n 56000 > /sys/class/hwmon/hwmon#/device/temp#_max_hyst

Note that the hysteresis is shared between max and crit, so only the temp#_max_hyst attributes are writable the temp#_crit_hyst attributes are readonly.

If the echo works and your sensors.conf still gives errors after removing the set statements for temp#_crit_hyst, we probably have a bug in libsensors or sensors somewhere.

Quoted 3 lines

If you need additional information, please just ask and I'll be glad to
provide it. Also, I tried enabling temp3 and that resulted in a wild value of 127 deg.C which is way off-scale high. Any ideas what this sensor does?

127 looks like not connected to me, I would expect the output of "sensors" to give a FAULT as reading for that sensors, what does:
cat /sys/class/hwmon/hwmon#/device/temp3_fault
Give as output?

Regards,

Hans

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

#2 lore raw

Re: [lm-sensors] f71882fg-* How do you set temp limits for max_hyst

In reply to David C. Rankin
Quoted 25 lines · Hans de Goede
Quoted 12 lines · David C. Rankin

sensor Devs,

I have an MSI K9N2 SLI Platinum board that has the f71882fg- chip.
I am unable
to set the tempX_max_hyst and tempX_crit_hyst temperature limits with sensors-3.0.2-4.1. Attempting to set the values results in the normal error
messages on sensors -s:

Error: Line 70: Unknown feature name
Error: Line 71: Unknown feature name

<snip>

Quoted 9 lines

set temp1_max_hyst 50
set temp1_max 55
set temp1_crit_hyst 56
set temp1_crit 60
set temp2_max_hyst 50
set temp2_max 55
set temp2_crit_hyst 56
set temp2_crit 60

Quoted 7 lines
Quoted 4 lines

However, all of the _hyst settings result in the errors explained
above. So,
how do you set the hyst limits with this chipset?

Erm, that should work. What does ls /sys/class/hwmon/hwmon*/device show ?

Left you speechless too....

23:18 sq4~> ls /sys/class/hwmon/hwmon*/device
driver fan3_beep in1_beep in7_input temp1_crit temp2_beep
temp3_alarm temp3_type
fan1_alarm fan3_input in1_input in8_input temp1_crit_hyst temp2_crit
temp3_beep uevent
fan1_beep fan4_alarm in1_max modalias temp1_fault
temp2_crit_hyst temp3_crit
fan1_input fan4_beep in2_input name temp1_input temp2_fault
temp3_crit_hyst
fan2_alarm fan4_input in3_input power temp1_max temp2_input
temp3_fault
fan2_beep hwmon in4_input subsystem temp1_max_hyst temp2_max
temp3_input
fan2_input in0_input in5_input temp1_alarm temp1_type temp2_max_hyst
temp3_max
fan3_alarm in1_alarm in6_input temp1_beep temp2_alarm temp2_type
temp3_max_hyst

Looking closer at the temp*, some are 0:

23:27 sq4~> ls -l /sys/devices/platform/f71882fg.2560/temp* -r--r--r-- 1 root root 4096 2008-10-19 21:18 /sys/devices/platform/f71882fg.2560/temp1_alarm -rw-r--r-- 1 root root 4096 2008-10-20 23:19 /sys/devices/platform/f71882fg.2560/temp1_beep
-rw-r--r-- 1 root root 0 2008-10-20 00:00
/sys/devices/platform/f71882fg.2560/temp1_crit -r--r--r-- 1 root root 4096 2008-10-19 21:18 /sys/devices/platform/f71882fg.2560/temp1_crit_hyst -r--r--r-- 1 root root 4096 2008-10-19 21:18 /sys/devices/platform/f71882fg.2560/temp1_fault -r--r--r-- 1 root root 4096 2008-10-19 21:18 /sys/devices/platform/f71882fg.2560/temp1_input
-rw-r--r-- 1 root root 0 2008-10-20 00:00
/sys/devices/platform/f71882fg.2560/temp1_max
-rw-r--r-- 1 root root 0 2008-10-19 21:29
/sys/devices/platform/f71882fg.2560/temp1_max_hyst -r--r--r-- 1 root root 4096 2008-10-19 21:18 /sys/devices/platform/f71882fg.2560/temp1_type -r--r--r-- 1 root root 4096 2008-10-19 21:18 /sys/devices/platform/f71882fg.2560/temp2_alarm -rw-r--r-- 1 root root 4096 2008-10-20 23:19 /sys/devices/platform/f71882fg.2560/temp2_beep
-rw-r--r-- 1 root root 0 2008-10-20 00:00
/sys/devices/platform/f71882fg.2560/temp2_crit -r--r--r-- 1 root root 4096 2008-10-19 21:18 /sys/devices/platform/f71882fg.2560/temp2_crit_hyst -r--r--r-- 1 root root 4096 2008-10-19 21:18 /sys/devices/platform/f71882fg.2560/temp2_fault -r--r--r-- 1 root root 4096 2008-10-19 21:18 /sys/devices/platform/f71882fg.2560/temp2_input
-rw-r--r-- 1 root root 0 2008-10-20 00:00
/sys/devices/platform/f71882fg.2560/temp2_max
-rw-r--r-- 1 root root 0 2008-10-19 21:29
/sys/devices/platform/f71882fg.2560/temp2_max_hyst -r--r--r-- 1 root root 4096 2008-10-19 21:18 /sys/devices/platform/f71882fg.2560/temp2_type -r--r--r-- 1 root root 4096 2008-10-19 21:18 /sys/devices/platform/f71882fg.2560/temp3_alarm -rw-r--r-- 1 root root 4096 2008-10-20 23:19 /sys/devices/platform/f71882fg.2560/temp3_beep -rw-r--r-- 1 root root 4096 2008-10-19 21:18 /sys/devices/platform/f71882fg.2560/temp3_crit -r--r--r-- 1 root root 4096 2008-10-19 21:18 /sys/devices/platform/f71882fg.2560/temp3_crit_hyst -r--r--r-- 1 root root 4096 2008-10-19 21:18 /sys/devices/platform/f71882fg.2560/temp3_fault -r--r--r-- 1 root root 4096 2008-10-19 21:18 /sys/devices/platform/f71882fg.2560/temp3_input -rw-r--r-- 1 root root 4096 2008-10-19 21:18 /sys/devices/platform/f71882fg.2560/temp3_max -rw-r--r-- 1 root root 4096 2008-10-19 21:18 /sys/devices/platform/f71882fg.2560/temp3_max_hyst

All of the hyst devices are there. I don't know why it is giving the errors on
set. However, I wonder if the way it is symlinked could be causing the problems? Note above, the actual /sys directory for the values is:

/sys/devices/platform/f71882fg.2560/

Quoted 3 lines

If there are temp#_max_hyst files there try:
echo -n 56000 > /sys/class/hwmon/hwmon#/device/temp#_max_hyst

Blind faith required.... A quick check first:

23:33 sq4~> cat /sys/devices/platform/f71882fg.2560/temp1_max_hyst 51000

Hmm, 51000, and that is what the temp1_max_hyst shows with sensors:

23:35 sq4~> sensors
f71882fg-isa-0a00
Adapter: ISA adapter
<snip>
CPU: +28.0°C (high = +55.0°C, hyst = +51.0°C)

                      (crit = +60.0°C, hyst = +56.0°C)  sensor = thermistor

System: +32.0°C (high = +55.0°C, hyst = +51.0°C)
(crit = +60.0°C, hyst = +56.0°C) sensor = transistor

OK, I'll try 50000 since that is actually what I wanted to set the max_hyst to:

[23:39 sq4/home/david] # echo -n 50000 >
/sys/class/hwmon/hwmon0/device/temp1_max_hyst
[23:40 sq4/home/david] # echo -n 50000 >
/sys/class/hwmon/hwmon0/device/temp2_max_hyst

[23:40 sq4/home/david] # sensors
f71882fg-isa-0a00
Adapter: ISA adapter
<snip>
CPU: +28.0°C (high = +55.0°C, hyst = +50.0°C)

                      (crit = +60.0°C, hyst = +55.0°C)  sensor = thermistor

System: +31.0°C (high = +55.0°C, hyst = +50.0°C)
(crit = +60.0°C, hyst = +55.0°C) sensor = transistor

Well that worked nicely! Now why wouldn't it accept the set variables from the
sensors3.conf file? Let's try again. A quick vi of sensors3.conf leaving:

# Set CPU and System temp limits

set temp1_max_hyst 50
set temp1_max 55
# set temp1_crit_hyst 56
set temp1_crit 60
set temp2_max_hyst 50
set temp2_max 55
# set temp2_crit_hyst 56
set temp2_crit 60

WTF? It worked! Hmm..., something is fishy here. Let's do another test:

23:42 sq4~> sudo echo -n 50000 > /sys/class/hwmon/hwmon0/device/temp1_max_hyst -bash: /sys/class/hwmon/hwmon0/device/temp1_max_hyst: Permission denied

$%#@%^@$%$ing sudo! I see the problem, but I don't know why. When the error
was generated, I was running sensors -s with sudo "sudo sensors -s" which has always worked before with all my other boxes. I wonder what the deal is here. Mystery solved, and another one to track down -- normal...

Quoted 3 lines

Note that the hysteresis is shared between max and crit, so only the temp#_max_hyst attributes are writable the temp#_crit_hyst attributes are readonly.

Yep, the above file permission bear that out.

Quoted 11 lines

If the echo works and your sensors.conf still gives errors after removing the set statements for temp#_crit_hyst, we probably have a bug in libsensors or sensors somewhere.

Quoted 5 lines

If you need additional information, please just ask and I'll be
glad to
provide it. Also, I tried enabling temp3 and that resulted in a wild value of
127 deg.C which is way off-scale high. Any ideas what this sensor does?

Quoted 9 lines

127 looks like not connected to me, I would expect the output of "sensors" to give a FAULT as reading for that sensors, what does:
cat /sys/class/hwmon/hwmon#/device/temp3_fault
Give as output?

Regards,

Hans

Thank you Hans. Bitten by sudo. At least we know libsensors is as good as ever
and it was just another "id ten t" error. (change the text within the quotes to all-caps and numerical 10 and remove the spaces)...

Signature · 8 lines
David C. Rankin, J.D., P.E.
Rankin Law Firm, PLLC
www.rankinlawfirm.com

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

Re: [lm-sensors] f71882fg-* How do you set temp limits for max_hyst

In reply to David C. Rankin

David C. Rankin wrote:

<snip>

Quoted 14 lines

Well that worked nicely! Now why wouldn't it accept the set variables from the
sensors3.conf file? Let's try again. A quick vi of sensors3.conf leaving:

# Set CPU and System temp limits

set temp1_max_hyst 50
set temp1_max 55
# set temp1_crit_hyst 56
set temp1_crit 60
set temp2_max_hyst 50
set temp2_max 55
# set temp2_crit_hyst 56
set temp2_crit 60

Quoted 2 lines

WTF? It worked! Hmm..., something is fishy here. Let's do another test:

Yes, note you've now commented out the set temp#_crit_hyst lines which were trying to set the readonly temp#_crit_hyst, which you did not (comment them out) with your first try, most likely those where causing the errors.

Quoted 7 lines

23:42 sq4~> sudo echo -n 50000 > /sys/class/hwmon/hwmon0/device/temp1_max_hyst -bash: /sys/class/hwmon/hwmon0/device/temp1_max_hyst: Permission denied

$%#@%^@$%$ing sudo! I see the problem, but I don't know why. When the error
was generated, I was running sensors -s with sudo "sudo sensors -s" which has always worked before with all my other boxes. I wonder what the deal is here. Mystery solved, and another one to track down -- normal...

sudo sensors -s will work fine, it will probably work on this system too now that you've fixed sensors.conf, the problem with this line:

23:42 sq4~> sudo echo -n 50000 > /sys/class/hwmon/hwmon0/device/temp1_max_hyst

Is that the echo runs as root, but the " > " runs as you, so /sys/class/hwmon/hwmon0/device/temp1_max_hyst gets opened as you. The correct way to do this using sudo is:

sudo bash -c "echo -n 50000 > /sys/class/hwmon/hwmon0/device/temp1_max_hyst"

Regards,

Hans

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

#4 lore raw

Re: [lm-sensors] f71882fg-* How do you set temp limits for max_hyst

In reply to David C. Rankin
Quoted 19 lines · Hans de Goede

David C. Rankin wrote:

<snip>

Quoted 15 lines

Well that worked nicely! Now why wouldn't it accept the set
variables from the
sensors3.conf file? Let's try again. A quick vi of sensors3.conf leaving:

# Set CPU and System temp limits

set temp1_max_hyst 50
set temp1_max 55
# set temp1_crit_hyst 56
set temp1_crit 60
set temp2_max_hyst 50
set temp2_max 55
# set temp2_crit_hyst 56
set temp2_crit 60

Quoted 9 lines
Quoted 3 lines

WTF? It worked! Hmm..., something is fishy here. Let's do another
test:

Yes, note you've now commented out the set temp#_crit_hyst lines which were trying to set the readonly temp#_crit_hyst, which you did not (comment them out) with your first try, most likely those where causing the errors.

Not quite. Originally, I was receiving errors on all of the temp#_max_hyst and temp#_crit_hyst (readonly) lines. I can't explain why the temp#_max_hyst lines were generating the errors when attempting to set with sudo, but I'm quite sure they were. In vi, I had line numbers visible (:set nu) and was testing setting the hyst values from within vi (:!sudo sensors -s) and after exiting vi with a simple sudo sensors -s and on both occasions the temp#_max_hyst lines were not being set and were generating the errors.

I have done close to 2 gig of updates since that time so maybe one of the updates fixed the sudo behavior. All is well now on openSuSE 11.0 with sensors3 and the f71882fg-* chipset.

Although, I still haven't a clue as to what temp3 is for the K9N2 SLI Platinum board.

Quoted 22 lines
Quoted 11 lines

23:42 sq4~> sudo echo -n 50000 > /sys/class/hwmon/hwmon0/device/temp1_max_hyst
-bash: /sys/class/hwmon/hwmon0/device/temp1_max_hyst: Permission denied

$%#@%^@$%$ing sudo! I see the problem, but I don't know why. When
the error
was generated, I was running sensors -s with sudo "sudo sensors -s" which has
always worked before with all my other boxes. I wonder what the deal is here.
Mystery solved, and another one to track down -- normal...

sudo sensors -s will work fine, it will probably work on this system too now that you've fixed sensors.conf, the problem with this line:

23:42 sq4~> sudo echo -n 50000 >
/sys/class/hwmon/hwmon0/device/temp1_max_hyst

Is that the echo runs as root, but the " > " runs as you, so /sys/class/hwmon/hwmon0/device/temp1_max_hyst gets opened as you. The correct way to do this using sudo is:

Quoted 7 lines

sudo bash -c "echo -n 50000 >
/sys/class/hwmon/hwmon0/device/temp1_max_hyst"

Regards,

Hans

Dang your good Hans! Not only have you solved the sensors3.conf conundrum, but you've taught this old dog a new BASH trick as well!

Seriously, thanks for helping me work through this issue and keep up the great work with sensors.

Signature · 12 lines
David C. Rankin, J.D., P.E.
Rankin Law Firm, PLLC
510 Ochiltree Street
Nacogdoches, Texas 75961
Telephone: (936) 715-9333
Facsimile: (936) 715-9339
www.rankinlawfirm.com

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