The key was the patch:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
40a41,42 > #define I8K_SMM _IOWR('i', 0x88, size_t) > 388a391,402 > static int i8k_smm_raw(int eax,int ebx,int ecx,int edx,int esi,int edi) > { > struct smm_regs regs = { .eax=eax, .ebx=ebx, .ecx=ecx, .edx=edx, .esi=esi, .edi=edi}; > int rc; > > rc = i8k_smm(®s); > if (rc < 0) > return rc; > > return 0; > } > 399a414 > int eax; int ebx; int ecx; int edx; int esi; int edi; 456a472,493 > case I8K_SMM: > if (copy_from_user(&eax, argp, sizeof(int))) > return -EFAULT; > > if (copy_from_user(&ebx, argp+1, sizeof(int))) > return -EFAULT; > > if (copy_from_user(&ecx, argp+2, sizeof(int))) > return -EFAULT; > > if (copy_from_user(&edx, argp+3, sizeof(int))) > return -EFAULT; > > if (copy_from_user(&esi, argp+4, sizeof(int))) > return -EFAULT; > > if (copy_from_user(&edi, argp+5, sizeof(int))) > return -EFAULT; > > val = i8k_smm_raw(eax,ebx,ecx,edx,esi,edi); > break; > 460d496 < |
@Credits go to someone as when downloading didn’t take a note and don’t have time to look for it.
The important part is that both smm from this package is required as well as module after each kernel has to be rebuilt (make) and installed in appropriate location
1 2 |
sudo mv /lib/modules/`uname -r`/kernel/drivers/hwmon/dell-smm-hwmon.ko /lib/modules/`uname -r`/kernel/drivers/hwmon/dell-smm-hwmon.ko.ori sudo cp ./dell-smm-hwmon.ko /lib/modules/`uname -r`/kernel/drivers/hwmon/dell-smm-hwmon.ko |
Files I’m using to disable (obligatory to have i8k running as otherwise can burn laptop). Content of /usr/local/sbin/fan-bios-disable
1 2 3 |
#!/bin/bash /usr/local/sbin/smm 30a3 |
Content of /usr/local/sbin/fan-bios-enable
1 2 3 |
#!/bin/bash /usr/local/sbin/smm 31a3 |
And /etc/i8kmon.con
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# Sample i8kmon configuration file (/etc/i8kmon.conf, ~/.i8kmon). # External program to control the fans set config(i8kfan) /usr/bin/i8kfan # Report status on stdout, override with --verbose option set config(verbose) 3 # Status check timeout (seconds), override with --timeout option set config(timeout) 2 # Temperature threshold at which the temperature is displayed in red set config(t_high) 80 # Temperature thresholds: {fan_speeds low_ac high_ac low_batt high_batt} # These were tested on the I8000. If you have a different Dell laptop model # you should check the BIOS temperature monitoring and set the appropriate # thresholds here. In doubt start with low values and gradually rise them # until the fans are not always on when the cpu is idle. set config(0) {{0 0} -1 55 -1 60} set config(1) {{1 1} 50 65 55 70} set config(2) {{2 2} 60 75 65 80} set config(3) {{2 2} 70 128 75 128} # Speed values are set here to avoid i8kmon probe them at every time it starts. set status(leftspeed) "0 1000 2000 3000" set status(rightspeed) "0 1000 2000 3000" #control fan speed set config(auto) 1 # end of file |
cpufreqd might be a good addition to control governors and maximum frequency, i.e. force lowest during the night to avoid any fan.
Disadvantage is that at least brightness control doesn’t work.
Searching for more details here can be found:
XPS 9560 – Battery life optimization and fan management from Dell
Great help was found at https://github.com/vitorafsr/i8kutils/issues/6