speed improvement with kernel 4.2.5 / 4.3.3 / 4.6.6

Re: speed improvement with kernel 4.2.5 / 4.3.3

Postby uelpenich » Mon Jan 04, 2016 8:37 pm

I googled some interesting information:
http://forum.nas-central.org/viewtopic.php?f=240&t=5791
the fan speed is set by i2c bus, gpio is only used to signal an alarm.

This command sets the fan speed:
root@2big2:/ # cd /sys/bus/i2c/devices/0-003e/hwmon/hwmon0
root@2big2:/sys/bus/i2c/devices/0-003e/hwmon/hwmon0 # echo 0 > pwm1
root@2big2:/sys/bus/i2c/devices/0-003e/hwmon/hwmon0 # echo 0 > pwm1
root@2big2:/sys/bus/i2c/devices/0-003e/hwmon/hwmon0 # echo 10 > pwm1
root@2big2:/sys/bus/i2c/devices/0-003e/hwmon/hwmon0 # echo 255 > pwm1
root@2big2:/sys/bus/i2c/devices/0-003e/hwmon/hwmon0 # echo 256 > pwm1
sh: write error: Invalid argument
root@2big2:/sys/bus/i2c/devices/0-003e/hwmon/hwmon0 #

0 = fan off
10 = minimal speed to start the fan
255 = maximal fan speed

http://natisbad.org/NAS5/#hw-fan-controller
The fan controller chip is a G782.
uelpenich
Donator VIP
Donator VIP
 
Posts: 120
Joined: Sun Jun 12, 2011 4:45 pm
Location: Cologne, Germany

Re: speed improvement with kernel 4.2.5 / 4.3.3

Postby fvdw » Mon Jan 04, 2016 9:17 pm

interesting uelpenich
I think you mean G762 instead of G782.
But I dont think there is a controller G762 on board as the driver is incorperated in the kernel but not loaded. On the 5big2 it is loaded (the G762) and the gpio-fan not.

But it might very well be that the fan can be controlled via i2c bus, it seems gpio-fan (hwmon) is using it. Luckily I initialized this i2c device by default for 5big2 and 2big2. On 5big2 the g762 driver uses the same i2c device 0-003e

In the folder /sys/bus/i2c/devices/0-003e/hwmon/hwmon0
There must be als a file with name "name", what is the content

can you post the content of the cd /sys/bus/i2c/devices/0-003e/hwmon/hwmon0 folder ? (ls -al)

need to do some reading
fvdw
Site Admin - expert
 
Posts: 13245
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: speed improvement with kernel 4.2.5 / 4.3.3

Postby fvdw » Mon Jan 04, 2016 9:22 pm

also there must a symlink "driver" in this folder to which file is that pointing to ?
fvdw
Site Admin - expert
 
Posts: 13245
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: speed improvement with kernel 4.2.5 / 4.3.3

Postby uelpenich » Mon Jan 04, 2016 10:14 pm

I think I have got it:
I think you mean G762 instead of G782.
You are right, it is a typing error.

Find the description of the G762 driver here:
https://github.com/MISL-EBU-System-SW/mainline-public/blob/master/Documentation/hwmon/g762
I think the driver G762 is present.

This is the difference between kernel 3.14.2 and 4.3.3:
There must be als a file with name "name"

The path to the files is different:
Code: Select all
3.14.2  /sys/bus/i2c/devices/0-003e
4.3.3   /sys/bus/i2c/devices/0-003e/hwmon/hwmon0
There must be als a file with name "name", what is the content
g762

More interesting is the content of the file pwm1 (fan speed [0 .. 255]):
Code: Select all
with kernel 3.14.2 it is 0
with kernel 4.3.3 it is 18


That means the fan runs with a speed of 18 out of 255, which is not full speed as I supposed. This is better than 0 as in 3.14.2 kernels.

All other files contain the same values. Since the fan is a 2-wire fan the G762 controller works in open-loop mode
(pwm1_enable=1; pwm1_mode=1)

also there must a symlink "driver" in this folder to which file is that pointing to ?

Code: Select all
root@2big2:/sys/bus/i2c/devices/0-003e # ls -l
total 0
lrwxrwxrwx  1 root root    0 2016-01-04 22:36 driver -> ../../../../../bus/i2c/drivers/g762
drwxr-xr-x  3 root root    0 2016-01-04 22:34 hwmon
-r--r--r--  1 root root 4096 2016-01-04 22:36 modalias
-r--r--r--  1 root root 4096 2016-01-04 22:36 name
drwxr-xr-x  2 root root    0 2016-01-04 22:36 power
lrwxrwxrwx  1 root root    0 2016-01-04 22:36 subsystem -> ../../../../../bus/i2c
-rw-r--r--  1 root root 4096 2016-01-04 22:34 uevent
root@2big2:/sys/bus/i2c/devices/0-003e #
can you post the content of the cd /sys/bus/i2c/devices/0-003e/hwmon/hwmon0 folder ? (ls -al)
Code: Select all
root@2big2:/sys/bus/i2c/devices/0-003e/hwmon # cd hwmon0
root@2big2:/sys/bus/i2c/devices/0-003e/hwmon/hwmon0 # ls -l
total 0
lrwxrwxrwx  1 root root    0 2016-01-04 22:36 device -> ../../../0-003e
-r--r--r--  1 root root 4096 2016-01-04 22:36 fan1_alarm
-rw-r--r--  1 root root 4096 2016-01-04 22:36 fan1_div
-r--r--r--  1 root root 4096 2016-01-04 22:36 fan1_fault
-r--r--r--  1 root root 4096 2016-01-04 22:36 fan1_input
-rw-r--r--  1 root root 4096 2016-01-04 22:36 fan1_pulses
-rw-r--r--  1 root root 4096 2016-01-04 22:36 fan1_target
-r--r--r--  1 root root 4096 2016-01-04 22:36 name
drwxr-xr-x  2 root root    0 2016-01-04 22:36 power
-rw-r--r--  1 root root 4096 2016-01-04 22:36 pwm1
-rw-r--r--  1 root root 4096 2016-01-04 22:36 pwm1_enable
-rw-r--r--  1 root root 4096 2016-01-04 22:36 pwm1_mode
lrwxrwxrwx  1 root root    0 2016-01-04 22:36 subsystem -> ../../../../../../../class/hwmon
-rw-r--r--  1 root root 4096 2016-01-04 22:34 uevent
root@2big2:/sys/bus/i2c/devices/0-003e/hwmon/hwmon0 #


Whats about a temperature sensor and a control loop to set the fan speed?
uelpenich
Donator VIP
Donator VIP
 
Posts: 120
Joined: Sun Jun 12, 2011 4:45 pm
Location: Cologne, Germany

Re: speed improvement with kernel 4.2.5 / 4.3.3

Postby fvdw » Mon Jan 04, 2016 10:45 pm

funny , I checked my 5big2 when running kernel 4.3.3 #6 and it also now uses /sys/bus/i2c/devices/0-003e/hwmon/hwmon0 as directory, instead of /sys/bus/i2c/devices/0-003e/ :shock:

this is the content

5big2-kernel-433-6.JPG


so indeed as well 2big2 as 5big2 seems to use the g762 driver, and if the content of the folder is the same so then it will be easy to adapt the fan daemon we use on the 5big2 for use on 2big2 also (based on actual disk temp measurements) :punk

need to find out why it changed the folder from /sys/bus/i2c/devices/0-003e/ to /sys/bus/i2c/devices/0-003e/hwmon/hwmon0 as now the fan daemon will not work on the 5big2 as well as it uses folder /sys/bus/i2c/devices/0-003e/ to control the speed
You do not have the required permissions to view the files attached to this post.
fvdw
Site Admin - expert
 
Posts: 13245
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: speed improvement with kernel 4.2.5 / 4.3.3

Postby fvdw » Tue Jan 05, 2016 10:49 pm

seems the location change is because of a kernel modification

https://lkml.org/lkml/2014/5/5/420

So I will need to add a check in the fan daemon and rcS script to find the right directory to have backwards compatibility :dry
fvdw
Site Admin - expert
 
Posts: 13245
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: speed improvement with kernel 4.2.5 / 4.3.3

Postby wd9895 » Sun Feb 14, 2016 6:52 pm

Hi fvdw,

will you integrate the new kernel in the next fw release or patch ?
wd9895
Donator Supporter
Donator Supporter
 
Posts: 255
Joined: Fri Jun 10, 2011 1:49 pm
Location: Hamburg, Germany

Re: speed improvement with kernel 4.2.5 / 4.3.3

Postby fvdw » Mon Feb 15, 2016 7:26 pm

Yes that is the intention also the fan daemon will be updated to suport old and new kernel
fvdw
Site Admin - expert
 
Posts: 13245
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: speed improvement with kernel 4.2.5 / 4.3.3

Postby fvdw » Sun Feb 21, 2016 10:17 pm

I updated the fan daemon so it is compatible with the 4.3.3 and also the older kernels

To use it you need to replace the file fan5big in the the folder /bin_cab
After installing it you should be able to run the 4.3.3 kernel with an working fan daemon

To be able to replace the file you need to kill the running fan daemon first
Code: Select all
killall fan-d


Be aware that if you kill the fan daemon that the fan is off,
reboot the nas after you replaced the fan daemon file to get the daemon active again
After reboot you can check if the daemon is running again by using this command
Code: Select all
ps -ef | grep fan-d

You should get this as response
Code: Select all
root@fvdwsl-5big2:/ # ps -ef | grep fan-d
root       931     1  0 22:59 ?        00:00:00 /usr/sbin/fan-d
root      2411  2397  0 23:16 pts/0    00:00:00 grep fan-d
root@fvdwsl-5big2:/ #
You do not have the required permissions to view the files attached to this post.
fvdw
Site Admin - expert
 
Posts: 13245
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: speed improvement with kernel 4.2.5 / 4.3.3

Postby fvdw » Tue Mar 01, 2016 8:43 pm

seems the kernel 4.3.3 #6 may fail to mount ext3 root file systems due to changes made in the linux kernel (ext3 driver is removed, the ext4 driver handling ext3 now, sometimes the root file system is now mounted as ext2 which is wrong as it cannot handle the journal).
The nasty thing is it it happens random, most of the time the mount is ok but sometimes not

attached a new version that solve this issue, only ext4 driver present which can also handle ext3 file systems

I recommend to use this new version (#7) for further tests

---edit there is a new version with a patch for bug in mv643 driver
viewtopic.php?f=4&t=2345&p=22201#p22201
fvdw
Site Admin - expert
 
Posts: 13245
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

PreviousNext

Return to Development

Who is online

Users browsing this forum: No registered users and 2 guests

cron