Fan running at full speed despite manual intervention

Hi,

The fan supplied with Ten64 is running at full speed. I am unable to change its speed.

root@OpenWrt:~# ls /sys/devices/platform/soc/2000000.i2c/i2c-0/0-002f/hwmon/
hwmon2
root@OpenWrt:~# cat /sys/class/hwmon/hwmon2/fan1_input
5453
root@OpenWrt:~# echo 3500 > /sys/class/hwmon/hwmon2/fan1_target

# my ears do not notice any change, and after few minutes still:
root@OpenWrt:~# cat /sys/class/hwmon/hwmon2/fan1_input
5453

Temperature does not seem to be high

root@OpenWrt:~# cat /sys/class/hwmon/hwmon1/temp*
38875
49750
48500

Version of OpenWrt:

root@OpenWrt:~# uname -a
Linux OpenWrt 5.4.61 #0 SMP PREEMPT Mon Dec 21 00:08:33 2020 aarch64 GNU/Linux
root@OpenWrt:~# cat /etc/banner
  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r0-6efa060
 -----------------------------------------------------

Modules loaded:

root@OpenWrt:~# lsmod | grep emc
emc17xx                16384  0
emc181x                16384  0
emc2301                16384  0
hwmon                  20480  5 ath10k_core,pac1934,emc2301,emc181x,emc17xx

However dmesg shows less information than the documentation page (Fan Control - Traverse Ten64 Documentation)

root@OpenWrt:~# dmesg | grep emc
[   15.103966] emc2301 0-002f: EMC2301 detected

Any suggestions?

The OpenWrt version on the NAND (with kernel 5.4) has an older version of the fan driver which does not enable fan speed control without external intervention.

The two solutions at the moment are:

  1. Install OpenWrt on a block device (SSD/USB/etc.) which will use the 5.10x kernel.
    You should notice the fan will spin down to a lower speed once the fan driver is loaded on bootup.
    (The fan speed will be governed by the Linux thermal subsystem to ensure you don’t cook your CPU)

  2. Enable PWM manually in U-Boot before booting
    The command to do this in U-Boot is:

=> fan enable_pwm emc2301@2f 0 1
enable_pwm argc: 5
Found controller emc2301@2f

Updating the NAND OpenWrt to the 5.10 kernel is on the TODO list, it’s lagging behind at the moment as 5.10 involved a “new” hardware target.

Option 2 works. Thanks!

@mcbridematt I am running OpenWrt 21.02 with kernel 5.10.64 now.

$ modprobe emc2301
$ dmesg | grep emc
$ ls /sys/class/hwmon/
hwmon0

0-002f is missing in ls /sys/devices/platform/soc/2000000.i2c/i2c-0/.

Also

4 dmesg | grep -i i2c
[    0.458920] imx-i2c 2000000.i2c: can't get pinctrl, bus recovery not supported
[    0.466445] i2c i2c-0: IMX I2C adapter registered
[    0.471267] imx-i2c 2020000.i2c: can't get pinctrl, bus recovery not supported
[    0.478612] i2c i2c-1: IMX I2C adapter registered
[    0.483413] imx-i2c 2030000.i2c: can't get pinctrl, bus recovery not supported
[    0.490779] i2c i2c-2: IMX I2C adapter registered
[    1.780367] i2c /dev entries driver
[   14.013123] i2c i2c-2: Added multiplexed i2c bus 3
[   14.018025] i2c i2c-2: Added multiplexed i2c bus 4
[   14.022820] pca954x 2-0070: registered 2 multiplexed busses for I2C mux pca9540
[   14.195431] libphy: SFP I2C Bus: probed
[   14.208583] libphy: SFP I2C Bus: probed

The 2000000.i2c is for emc2301, isn’t it?

The sensors/hwmon are missing because I used the wrong device tree (the one I have prepared for kernel upstream).

I have an updated build (385324885) here, it should fix this issue.

You can upgrade to it using openwrt-arm64-ten64-mtd-ubifs-sysupgrade.tar

Unfortunately, after upgrading with the image above via UI, the router is not back. I will connect to it via serial console in few hours to see what’s going on.

The machine was dead. It seems it hang on upgrade. I have repeated installation of the above image via UI, but with serial console attached - no error, upgrade went without any hiccups.

Next time will have serial console attached as well, maybe then I will spot the issue.