Wer-Wolf / i8kutils

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

i8kmon doesn't change fan state #5

Closed mrmostafaxd closed 4 months ago

mrmostafaxd commented 4 months ago

Hello @Wer-Wolf,

I have installed this fork, but it doesn't seem to work. I am using Arch Linux with kernel version 6.9.1-arch1-1 on a Dell G15 5511 laptop.

Here is the testing configuration I'm using (located at /etc/i8kmon.conf):

set config(timeout)     2

# Only update fan speed when thresholds where exceeded
set config(ondemand)    0

# Number of temperature configurations
set config(num_configs) 5

# Temperature thresholds: {fan_speeds low_ac high_ac low_batt high_batt}
set config(0)   {{2 2}  -1  50  -1  50}
set config(1)   {{2 2}  45  55  45  55}
set config(2)   {{2 2}  50  65  50  65}
set config(3)   {{2 2}  60  70  60  70}
set config(4)   {{2 2}  65 128  65 128}

Output of sudo i8kmon -v command:

[Tue May 21 21:09:24 EEST 2024] [i8kmon] [debug] 'config entry 0: battery = -1 °C - 50 °C, ac = -1 °C - 50 °C'
[Tue May 21 21:09:24 EEST 2024] [i8kmon] [debug] 'config entry 1: battery = 45 °C - 55 °C, ac = 45 °C - 55 °C'
[Tue May 21 21:09:24 EEST 2024] [i8kmon] [debug] 'config entry 2: battery = 50 °C - 65 °C, ac = 50 °C - 65 °C'
[Tue May 21 21:09:24 EEST 2024] [i8kmon] [debug] 'config entry 3: battery = 60 °C - 70 °C, ac = 60 °C - 70 °C'
[Tue May 21 21:09:24 EEST 2024] [i8kmon] [debug] 'config entry 4: battery = 65 °C - 128 °C, ac = 65 °C - 128 °C'
[Tue May 21 21:09:24 EEST 2024] [i8kmon] [info] 'power status: running on ac power (Adapter 0: on-line)'
[Tue May 21 21:09:24 EEST 2024] [i8kmon] [debug] 'temperature: 57 °C'
[Tue May 21 21:09:24 EEST 2024] [i8kmon] [debug] 'temperature above state 0 threshold (50 °C)'
[Tue May 21 21:09:24 EEST 2024] [i8kmon] [debug] 'temperature above state 1 threshold (55 °C)'
[Tue May 21 21:09:24 EEST 2024] [i8kmon] [debug] 'switched to state 2'
[Tue May 21 21:09:26 EEST 2024] [i8kmon] [debug] 'temperature: 57 °C'
[Tue May 21 21:09:26 EEST 2024] [i8kmon] [debug] 'switched to state 2'
[Tue May 21 21:09:28 EEST 2024] [i8kmon] [debug] 'temperature: 57 °C'
[Tue May 21 21:09:28 EEST 2024] [i8kmon] [debug] 'switched to state 2'
[Tue May 21 21:09:30 EEST 2024] [i8kmon] [debug] 'temperature: 57 °C'
[Tue May 21 21:09:31 EEST 2024] [i8kmon] [debug] 'switched to state 2'
[Tue May 21 21:09:33 EEST 2024] [i8kmon] [debug] 'temperature: 57 °C'
[Tue May 21 21:09:33 EEST 2024] [i8kmon] [debug] 'switched to state 2'
[Tue May 21 21:09:35 EEST 2024] [i8kmon] [debug] 'temperature: 57 °C'
[Tue May 21 21:09:35 EEST 2024] [i8kmon] [debug] 'switched to state 2'

Output of i8kctl command:

fan 1 state: 1
fan 2 state: 1
temperature 1: 57 °C
temperature 2: 53 °C
temperature 3: 58 °C
temperature 4: 53 °C
temperature 5: 37 °C
temperature 6: 53 °C

Output of systemctl status i8kmon.service:

● i8kmon.service - DELL notebook fan control
     Loaded: loaded (/usr/lib/systemd/system/i8kmon.service; disabled; preset: disabled)
     Active: active (running) since Tue 2024-05-21 21:08:42 EEST; 17s ago
       Docs: man:i8kmon(1)
    Process: 47611 ExecStartPre=/usr/bin/i8kctl mode1 manual (code=exited, status=1/FAILURE)
   Main PID: 47612 (tclsh)
      Tasks: 2 (limit: 18841)
     Memory: 2.3M (peak: 2.9M)
        CPU: 186ms
     CGroup: /system.slice/i8kmon.service
             └─47612 tclsh /usr/bin/i8kmon

May 21 21:08:42 archlinux systemd[1]: Starting DELL notebook fan control...
May 21 21:08:42 archlinux i8kctl[47611]: i8kctl: fan 1 mode controls not found: couldn't open "/sys/class/hwmon/hwmon4/pwm1_enable": no such file or directory
May 21 21:08:42 archlinux systemd[1]: Started DELL notebook fan control.
Wer-Wolf commented 4 months ago

Can you send me the output of acpidump and dmidecode?

mrmostafaxd commented 4 months ago

Thank you for your help!

here are acpidump and dmidecode outputs.

Wer-Wolf commented 4 months ago

dell-smm-hwmon.zip

Can you compile this kernel module with make and load it with sudo insmod dell-smm-hwmon.ko (unload the old driver first with sudo modprobe -r dell-smm-hwmon)?

After restarting i8kctl, the fan states should change.

mrmostafaxd commented 4 months ago

I tested i8kutils with the modified kernel module and it worked, thank you again for your help!

Just a side question, is there a way to reload the old kernel module?

Wer-Wolf commented 4 months ago

Yes, just unload the new kernel module with sudo modprobe -r dell-smm-hwmon and reload the old kernel module with sudo modprobe dell-smm-hwmon.

Wer-Wolf commented 4 months ago

I will send the necessary patches upstream so your device should work out of the box with kernel 6.11.

mrmostafaxd commented 3 months ago

Hello @Wer-Wolf , I switched to Ubuntu 24.04 which has kernel version 6.8.0-35-generic , I followed the instructions in the README.md for installing the dependencies and building i8kutils from source, but it doesn't work.

here is the output of systemctl status i8kmon.service:

○ i8kmon.service - DELL notebook fan control
     Loaded: loaded (/usr/lib/systemd/system/i8kmon.service; disabled; preset: enabled)
     Active: inactive (dead)
       Docs: man:i8kmon(1)

Jun 24 01:54:22 g15-5511 systemd[1]: Starting i8kmon.service - DELL notebook fan control...
Jun 24 01:54:22 g15-5511 i8kctl[17150]: i8kctl: fan 1 mode controls not found: couldn\'t open "/sys/class/hwmon/hwmon5/pwm1_enable": no such file or directory
Jun 24 01:54:22 g15-5511 systemd[1]: Started i8kmon.service - DELL notebook fan control.
Jun 24 01:54:49 g15-5511 systemd[1]: Stopping i8kmon.service - DELL notebook fan control...
Jun 24 01:54:49 g15-5511 i8kctl[17357]: i8kctl: fan 1 mode controls not found: couldn\'t open "/sys/class/hwmon/hwmon5/pwm1_enable": no such file or directory
Jun 24 01:54:49 g15-5511 systemd[1]: i8kmon.service: Deactivated successfully.
Jun 24 01:54:49 g15-5511 systemd[1]: Stopped i8kmon.service - DELL notebook fan control.

here is the output of uname -a:

Linux g15-5511 6.8.0-35-generic #35-Ubuntu SMP PREEMPT_DYNAMIC Mon May 20 15:51:52 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

here are acpidump and dmidecode outputs.


I tried to build dell_smm_hwmon kernel module using the file:

dell-smm-hwmon.zip

but it fails with the following log:

make -C /lib/modules/`uname -r`/build M=`pwd` modules
make[1]: Entering directory '/usr/src/linux-headers-6.8.0-35-generic'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: x86_64-linux-gnu-gcc-13 (Ubuntu 13.2.0-23ubuntu4) 13.2.0
  You are using:           gcc-13 (Ubuntu 13.2.0-23ubuntu4) 13.2.0
  CC [M]  /home/dell/Downloads/dell-smm-hwmon/dell-smm-hwmon.o
/home/dell/Downloads/dell-smm-hwmon/dell-smm-hwmon.c:1611:10: error: ‘struct wmi_driver’ has no member named ‘no_singleton’
 1611 |         .no_singleton = true,
      |          ^~~~~~~~~~~~
/home/dell/Downloads/dell-smm-hwmon/dell-smm-hwmon.c:1611:25: warning: initialization of ‘void (*)(struct wmi_device *)’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
 1611 |         .no_singleton = true,
      |                         ^~~~
/home/dell/Downloads/dell-smm-hwmon/dell-smm-hwmon.c:1611:25: note: (near initialization for ‘dell_smm_wmi_driver.remove’)
make[3]: *** [scripts/Makefile.build:243: /home/dell/Downloads/dell-smm-hwmon/dell-smm-hwmon.o] Error 1
make[2]: *** [/usr/src/linux-headers-6.8.0-35-generic/Makefile:1926: /home/dell/Downloads/dell-smm-hwmon] Error 2
make[1]: *** [Makefile:240: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.8.0-35-generic'
make: *** [Makefile:5: all] Error 2
Wer-Wolf commented 3 months ago

You kernel is too old, the necessary patch lands in 6.10 i think. Give me some time and i will provide you with a backported kernel module.

Wer-Wolf commented 3 months ago

dell-smm-hwmon.zip

Here it is.

mrmostafaxd commented 3 months ago

dell-smm-hwmon.zip

Here it is.

It worked, thank you.


Also for anyone tried to load the modified kernel module and got the following error:

insmod: ERROR: could not insert module : Key was rejected by service

then disable Secure boot.