FS#65543 - [linux] cpupower unable to change frequency and governor for kernel >= 5.5.3
Attached to Project:
Arch Linux
Opened by Marcin Rzeźnicki (mrzeznicki) - Tuesday, 18 February 2020, 14:02 GMT
Last edited by Jan Alexander Steffens (heftig) - Friday, 06 March 2020, 15:41 GMT
Opened by Marcin Rzeźnicki (mrzeznicki) - Tuesday, 18 February 2020, 14:02 GMT
Last edited by Jan Alexander Steffens (heftig) - Friday, 06 March 2020, 15:41 GMT
|
Details
I am not sure if this belongs to upstream or not. I've been
checking new kernel bug reports but nothing is coming up -
also, people on non-Intel CPUs (not using intel-pstate) seem
to be unaffected.
Upgrading kernel to >= 5.5.4 seems to be breaking cpupower. Downgrading cpupower to 5.5.4-3 does not help, so this is on kernel. The last working version is 5.5.2-2. Symptoms cpupower.service fails to start resulting in frequency policy not applied: ● cpupower.service - Apply cpupower configuration Loaded: loaded (/usr/lib/systemd/system/cpupower.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Mon 2020-02-17 17:24:56 CET; 25min ago Process: 573 ExecStart=/usr/lib/systemd/scripts/cpupower (code=exited, status=1/FAILURE) Main PID: 573 (code=exited, status=1/FAILURE) CPU: 9ms Trying to invoke the script by hand ends with: > cpupower frequency-set -g powersave -d 800MHz -u 4500MHz > Setting cpu: 0 > wrong, unknown or unhandled CPU? > Error setting new values. Common errors: ... Similarily cpupower-gui throws: File "/usr/lib/cpupower-gui/cpupower-gui-helper", line 144, in read_governor governor = sys_file.readline().strip() OSError: [Errno 22] Invalid argument I did a little debugging session using strace. The problem seems to result from failure to read /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor - the file is mysteriously empty on my machine after the upgrade openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor", O_RDONLY) = 3 read(3, 0x7ffce74e49e0, 4095) = -1 EINVAL (Invalid argument) Trying to read the current cpupower settings is broken as well > cpupower frequency-info > analyzing CPU 0: > driver: intel_pstate > CPUs which run at the same hardware frequency: 0 > CPUs which need to have their frequency coordinated by software: 0 > maximum transition latency: Cannot determine or is not supported. > hardware limits: 800 MHz - 4.50 GHz > available cpufreq governors: performance powersave !!! > Unable to determine current policy !!! > current CPU frequency: Unable to call hardware > current CPU frequency: 4.12 GHz (asserted by call to kernel) > boost state support: > Supported: yes > Active: yes |
This task depends upon
Closed by Jan Alexander Steffens (heftig)
Friday, 06 March 2020, 15:41 GMT
Reason for closing: Fixed
Additional comments about closing: 5.5.8
Friday, 06 March 2020, 15:41 GMT
Reason for closing: Fixed
Additional comments about closing: 5.5.8
makepkg -ors #download the source and run prepare
cd src/archlinux-linux
git revert -n 41ddb7e1f79693d904502ae9bea609837973eff8
git revert -n ae2917093fb60bdc1ed3e5757b74801420569a9
git revert -n 16d51c1c10ed9993c5d97c3126ceac5b579c60b7
cd ../..
makepkg -ersi # build the modified source and install it and test if the issue is fixed.
If the issue was fixed by that to re apply the last reverted commit
cd src/archlinux-linux
git cherry-pick -n 16d51c1c10ed9993c5d97c3126ceac5b579c60b7
cd ../..
makepkg -ersi # build the modified source and install it check if that reintroduced the issue.
Then repeat for the other two commits if needed.
[1] https://wiki.archlinux.org/index.php/Arch_Build_System#Retrieve_PKGBUILD_source_using_Git
sudo systemctl restart cpupower.service
Job for cpupower.service failed because the control process exited with error code.
See "systemctl status cpupower.service" and "journalctl -xe" for details.
Then I edit /etc/default/cpupower and comment this lines:
min_freq="800MHz"
max_freq="3GHz"
I restart service and now all works but... if I uncomment freq lines and restart, every setting than I have in cpupower works with no errors.