Controlling the Yeeloong fan speed

Initially published on 2011-04-28.

By default, the fan inside Lemote Yeeloong spins at pretty loud 4300 RPM almost all the time when powered-on.

On the recent Linux-libre for Lemote kernels the fan speed can be controlled via writing values to /sys/class/hwmon/hwmon0/pwm1.

Command Fan speed
echo 0 > /sys/class/hwmon/hwmon0/pwm1 250 RPM (?)
echo 1 > /sys/class/hwmon/hwmon0/pwm1 3300 RPM
echo 2 > /sys/class/hwmon/hwmon0/pwm1 3700 RPM
echo 3 > /sys/class/hwmon/hwmon0/pwm1 4300 RPM

Values higher than 3 work identically to 3. The value of 0 makes sensors report 250 RPM for the fan, but it is suspected that this reading is wrong, and the fan is just turned completely off in this case.

The difference in cooling between 3300 and 3700 RPM is not very significant, but it makes quite a bit more noise at 3700.

The fan speed can be dynamically adjusted from user-space without risking overheating the Yeeloong by setting it (statically) too low.

First, install the program called thinkfan, then save the following into its config file:

/etc/thinkfan.conf
sensor /sys/devices/virtual/hwmon/hwmon0/temp1_input
fan /sys/class/hwmon/hwmon0/pwm1
(0, 0, 62)
(1, 60, 64)
(2, 62, 66)
(3, 64, 32767)

The format of the threshold lines is (fan step, temperature on which to step down, temperature on which to step up).

You can experiment with the values so that the thresholds help your Yeeloong stay at the temperature levels you consider safe (for me that's no higher than ~65C).

Monitoring the temperature is possible with the sensors program from the lm-sensors package. Using the config file above, the CPU in my Yeeloong runs at about 60-62 degrees Celsius, and mostly with the fan off.


loongson/yeeloong-fan.txt · Last modified: 2011-09-28 09:19 UTC by rm