vitorafsr / i8kutils

Fan control for some Dell laptops
https://launchpad.net/i8kutils
GNU General Public License v3.0
219 stars 28 forks source link

Support disabling automatic BIOS fan control #26

Open giomasce opened 4 years ago

giomasce commented 4 years ago

Hi. Starting from version 5.5 Linux supports disabling the automatic BIOS fan control through the sysfs interface of module dell-smm-hwmon. It would be nice if i8kutils detected this possibility and automatically disabled BIOS fan control when applicable. See pwm1_enable in the relevant documentation.

Notice that for the moment very few laptop models actually support this feature, because Linux maintainers want to make it available only on models where it has been tested. The documentation page linked above also details how to test your own model and possibly report a patch to make it work.

kylebakerio commented 3 years ago

Yeah, this would be really nice to have. I've added a walkthrough on this answer for implementing it on a supported model: https://askubuntu.com/a/1319565/422405

but it would be ideal if it was built in.

kylebakerio commented 3 years ago

https://www.kernel.org/doc/html/latest/hwmon/dell-smm-hwmon.html

If pwm1_enable is not available, then it means that SMM codes for enabling and disabling automatic BIOS fan control are not whitelisted for your hardware. It is possible that codes that work for other laptops actually work for yours as well, or that you have to discover new codes.

Check the list i8k_whitelist_fan_control in file drivers/hwmon/dell-smm-hwmon.c in the kernel tree: as a first attempt you can try to add your machine and use an already-known code pair. If, after recompiling the kernel, you see that pwm1_enable is present and works (i.e., you can manually control the fan speed), then please submit your finding as a kernel patch, so that other users can benefit from it. Please see Submitting patches: the essential guide to getting your code into the kernel for information on submitting patches.

If no known code works on your machine, you need to resort to do some probing, because unfortunately Dell does not publish datasheets for its SMM. You can experiment with the code in this repository to probe the BIOS on your machine and discover the appropriate codes.