You are not logged in.

#1 2013-03-30 01:41:27

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,592
Website

Thoughts on hwmon symlink targets changing on reboot [SOLVED]

Quite a bit in google on this topic but no hard fixes.  Basically, the assignments of various hwmon symlinks change on each reboot.  This causes fancontrol as well as my own little temp script to file as a result.  For example:

% ls /sys/class/hwmon/ -al
total 0
drwxr-xr-x  2 root root 0 Mar 29 21:48 .
drwxr-xr-x 38 root root 0 Mar 29 21:48 ..
lrwxrwxrwx  1 root root 0 Mar 29 21:48 hwmon0 -> ../../devices/virtual/hwmon/hwmon0
lrwxrwxrwx  1 root root 0 Mar 29 21:48 hwmon1 -> ../../devices/platform/eeepc-wmi/hwmon/hwmon1
lrwxrwxrwx  1 root root 0 Mar 29 21:48 hwmon2 -> ../../devices/platform/coretemp.0/hwmon/hwmon2
lrwxrwxrwx  1 root root 0 Mar 29 21:48 hwmon3 -> ../../devices/platform/nct6775.656/hwmon/hwmon3

Here you see that coretemp.0 is #2 and nct6775 is #3.  Upon a reboot they shifted:

% ls /sys/class/hwmon/ -al
total 0
drwxr-xr-x  2 root root 0 Mar 29 21:50 .
drwxr-xr-x 38 root root 0 Mar 29 21:50 ..
lrwxrwxrwx  1 root root 0 Mar 29 21:50 hwmon0 -> ../../devices/virtual/hwmon/hwmon0
lrwxrwxrwx  1 root root 0 Mar 29 21:50 hwmon1 -> ../../devices/platform/coretemp.0/hwmon/hwmon1
lrwxrwxrwx  1 root root 0 Mar 29 21:50 hwmon2 -> ../../devices/platform/eeepc-wmi/hwmon/hwmon2
lrwxrwxrwx  1 root root 0 Mar 29 21:50 hwmon3 -> ../../devices/platform/nct6775.656/hwmon/hwmon3

Now... coretemp.0 is #1 and nct6775 is #3.

Related:
https://bbs.archlinux.org/viewtopic.php?id=80012
https://bbs.archlinux.org/viewtopic.php?id=121537

Last edited by graysky (2013-03-30 14:35:46)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2013-03-30 09:29:38

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: Thoughts on hwmon symlink targets changing on reboot [SOLVED]

These numbers are assigned serially in the order drivers are loaded.

Use /sys/devices paths instead.

Offline

#3 2013-03-30 10:54:35

progandy
Member
Registered: 2012-05-17
Posts: 5,180

Re: Thoughts on hwmon symlink targets changing on reboot [SOLVED]

You could also load the Moduls manually in the right order using modules-load.d


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#4 2013-03-30 14:38:57

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,592
Website

Re: Thoughts on hwmon symlink targets changing on reboot [SOLVED]

@progandy - Thanks for this suggestion.

Strategy is not to rely on /etc/conf.d/lm_sensors generated by `sensors-detect` for module loading, but instead to do it manually.

1) Remove lm_sensors.serivce from autostart.
2) Place needed modules in /etc/modules-load.d/load_these.conf.
3) Reboot.

% cat /etc/modules-load.d/load_these.conf 
microcode
coretemp
lm75
nct6775

Now this order do not change over 5 reboots (scripts and /usr/sbin/fancontrol are happy as a result):

 ls /sys/class/hwmon/ -al
total 0
drwxr-xr-x  2 root root 0 Mar 30 10:35 .
drwxr-xr-x 38 root root 0 Mar 30 10:35 ..
lrwxrwxrwx  1 root root 0 Mar 30 10:35 hwmon0 -> ../../devices/platform/coretemp.0/hwmon/hwmon0
lrwxrwxrwx  1 root root 0 Mar 30 10:35 hwmon1 -> ../../devices/platform/nct6775.656/hwmon/hwmon1
lrwxrwxrwx  1 root root 0 Mar 30 10:35 hwmon2 -> ../../devices/virtual/hwmon/hwmon2
lrwxrwxrwx  1 root root 0 Mar 30 10:35 hwmon3 -> ../../devices/platform/eeepc-wmi/hwmon/hwmon3

EDIT: Updated the wiki with this info in hopes that someone finds it useful in the future: https://wiki.archlinux.org/index.php/Fan_Speed_Control

Last edited by graysky (2013-03-30 14:53:45)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#5 2013-05-14 07:20:41

thenextdon13
Member
Registered: 2013-01-18
Posts: 58

Re: Thoughts on hwmon symlink targets changing on reboot [SOLVED]

Thanks for updating the wiki, I just ran into this problem and have applied the fix of loading in modules-load.d/load_these.conf (which i assume can be any filename.conf)

If I see any issues in the future will update thread again.

Offline

#6 2014-05-14 19:21:51

close2
Member
Registered: 2006-09-08
Posts: 12

Re: Thoughts on hwmon symlink targets changing on reboot [SOLVED]

Another work around is to use absolute device names in fancontrol's config file.

My config file generated by pwmconfig was:

# Configuration file generated by pwmconfig, changes will be lost
INTERVAL=30
DEVPATH=hwmon2=devices/pci0000:00/0000:00:02.0/0000:01:00.0 hwmon5=devices/platform/it87.656
DEVNAME=hwmon2=radeon hwmon5=it8721
FCTEMPS=hwmon5/device/pwm3=hwmon2/temp1_input
FCFANS= hwmon5/device/pwm3=hwmon5/device/fan3_input
MINTEMP=hwmon5/device/pwm3=55
MAXTEMP=hwmon5/device/pwm3=90
MINSTART=hwmon5/device/pwm3=140
MINSTOP=hwmon5/device/pwm3=60

I then simply removed all hwmon references and used absolute device paths:

INTERVAL=30
FCTEMPS= /sys/devices/platform/it87.656/hwmon/hwmon[[:print:]]*/device/pwm3=/sys/devices/pci0000:00/0000:00:02.0/0000:01:00.0/hwmon/hwmon[[:print:]]*/temp1_input
FCFANS= /sys/devices/platform/it87.656/hwmon/hwmon[[:print:]]*/device/pwm3=/sys/devices/platform/it87.656/hwmon/hwmon[[:print:]]*/device/fan3_input
MINTEMP= /sys/devices/platform/it87.656/hwmon/hwmon[[:print:]]*/device/pwm3=55
MAXTEMP= /sys/devices/platform/it87.656/hwmon/hwmon[[:print:]]*/device/pwm3=90
MINSTART= /sys/devices/platform/it87.656/hwmon/hwmon[[:print:]]*/device/pwm3=140
MINSTOP= /sys/devices/platform/it87.656/hwmon/hwmon[[:print:]]*/device/pwm3=60

fancontrol is a bash script and uses grep to extract multiple configurations from every line.

[[:print:]]*

works both in bash during file expansion and for egrep.

Note that DEVPATH is no longer allowed and DEVNAME not necessary (you could probably adapt the DEVNAME line if you want fancontrol to verify that the device is still the same).

Last edited by close2 (2014-05-14 19:24:18)

Offline

#7 2014-05-14 20:34:12

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Thoughts on hwmon symlink targets changing on reboot [SOLVED]

This is better suited to the wiki: please don't necrobump https://wiki.archlinux.org/index.php/Fo … Bumping.27



Closing


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB