Changing the fan temperture points with ectool

After listen to annoying fan noises for way too long I figured that I could dig into the framework EmbeddedController source code to see if it could be fixed.

Well, I found that the temperature points for the fan can be adjusted! And that’s all I wanted.

WARNING: running your laptop at higher temperatures might shorten its lifetime. This might not be covered by warranty. Misconfiguring a “halt” temperature could result in a long recovery session.

Prerequisite

Get a ectool version with frame.work support (see e.g. the fw-ectool tool (link removed due to spam restrictions)) and build it with make utils.

Relevant commands

List the RPM target of all fans

$ sudo ./build/bds/util/ectool pwmgetfanrpm all
Fan 0 RPM: 1953

List all temperature readings

$ sudo ./build/bds/util/ectool temps all
0: 317 K
1: 323 K
2: 319 K
3: 309 K
4: 324 K

List the temperature thresholds

$ sudo ./build/bds/util/ectool thermalget 
sensor  warn  high  halt   fan_off fan_max   name
  0        0   361    371    313     335     F75303_Local
  1        0   361    371    313     342     F75303_CPU
  2        0   360    370    313     335     F75303_DDR
  3        0   323    333    313     323     Battery
  4      368   376    378    377     378     PECI
EC returned error result code 3
(all temps in degrees Kelvin)

Here is a temperature translation:

sensor  warn   high   halt  fan_off fan_max   name
  0        0   88°C   98°C     40°C    62°C   F75303_Local
  1        0   88°C   98°C     40°C    69°C   F75303_CPU
  2        0   87°C   97°C     40°C    62°C   F75303_DDR
  3        0   50°C   60°C     40°C    50°C   Battery
  4     95°C  103°C  105°C    104°C   105°C   PECI

Setting new tipping points

Let’s set the CPU fan_off point to 60°C (~333K) and the maximum speed to 80°C (~353K) via thermalset

# thermalset <sensor id> <warn> <halt> <fan_off> <fan_max>
sudo ./build/bds/util/ectool thermalset 1 0 361 371 333 353

Set the Local and DDR points to 47°C-70°C (320-343K)

sudo ./build/bds/util/ectool thermalset 0 0 361 371 320 343
sudo ./build/bds/util/ectool thermalset 2 0 360 370 320 343

Verify that the new tables, temperatures and fan RPMs

sudo ./build/bds/util/ectool thermalget ; sudo ./build/bds/util/ectool temps all ; sudo ./build/bds/util/ectool pwmgetfanrpm all
sensor  warn  high  halt   fan_off fan_max   name
  0        0   361    371    320     343     F75303_Local
  1        0   361    371    333     353     F75303_CPU
  2        0   360    370    320     343     F75303_DDR
  3        0   323    333    313     323     Battery
  4      368   376    378    377     378     PECI
0: 317 K
1: 322 K
2: 319 K
3: 309 K
4: 325 K
Fan 0 RPM: 0

Enjoy a way more silent Laptop!

13 Likes

Nice find and write-up.

This gets me one step closer to my “fan before CPU throttle while on full strength external power, but throttle before fan on battery and weak external power” automagic mode setting goals…

Is this persistent between multiple power cycles / reboots?

Psst:

2 Likes

(post deleted by author)

fw-fanctrl was the reason I looked into the code, it’s a great tool. But I was concerned about what might happen if userspace crashes / hibernates / … so I wanted to see if the embedded controller could handle it.

The corresponding ec code would be this function that translates low/high/current temperature into fan %.
I don’t think a linear function is great for this, so fw-fanctrl does have an advantage here, but the simplicity and stability of an ec managed fan were key for me.

3 Likes