I sometimes use the userspace cpu governor with scaling_setspeed = scaling_min_freq in order to keep the cpu cool (less hot) and the fans at minimum speed. When I suspend the selected governor is saved, but the scaling_cur_freq is lost, as it suspends it switches to the TEMPORARY_CPUFREQ_GOVERNOR="performance" governor, so when resuming the governor is switched back to userspace but the speed of the cpu doesn't change and gets stuck at maximum. I implemented the saving of scaling_cur_freq and the writing of scaling_setspeed, I choose to read the speed from scaling_cur_freq because some governors when reading scaling_setspeed report "<unsupported>" as they do not allow changing the speed, and I added an ugly 2>/dev/null when setting the speed because it was faster and more "future proof" than checking the governor and implementing a white list of governors that allow setting the speed. I have been using this patch for two months without problems, as you can see, it's very simple, there shouldn't be any. Reproducible: Always Steps to Reproduce: 1. Have your system with the userspace cpu governor 2. Set a cpu speed that it's not the maximum speed 3. Suspend the computer 4. Wake up the computer Actual Results: The cpu governor is correctly retained and set to userspace, but the speed is set to maximum Expected Results: The cpu speed should have been saved and restored like the governor. As it seems that the pm-utils in bugs.freedesktop.org are not being watched too much I at least propose the patch here. I already sent the patch to freedesktop.org -> https://bugs.freedesktop.org/show_bug.cgi?id=69238 .
Created attachment 362120 [details, diff] Patch implementing the saving of cpu speed It's just saving the cpu speed in a state file in hibernate_cpufreq, and a second loop in thaw_cpufreq setting it after the governor has been set.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f146bb7e14ac3405429772d4adfef555f7810c20 commit f146bb7e14ac3405429772d4adfef555f7810c20 Author: Jakov Smolic <jakov.smolic@sartura.hr> AuthorDate: 2021-02-21 10:56:16 +0000 Commit: David Seifert <soap@gentoo.org> CommitDate: 2021-02-21 10:56:16 +0000 sys-power/pm-utils: Remove last-rited pkg Closes: https://bugs.gentoo.org/659616 Closes: https://bugs.gentoo.org/703026 Closes: https://bugs.gentoo.org/666380 Closes: https://bugs.gentoo.org/579912 Closes: https://bugs.gentoo.org/549848 Closes: https://bugs.gentoo.org/533168 Closes: https://bugs.gentoo.org/489650 Closes: https://bugs.gentoo.org/443530 Closes: https://bugs.gentoo.org/442052 Closes: https://bugs.gentoo.org/437930 Closes: https://bugs.gentoo.org/426952 Closes: https://bugs.gentoo.org/426510 Closes: https://bugs.gentoo.org/403523 Closes: https://bugs.gentoo.org/401257 Closes: https://bugs.gentoo.org/362387 Closes: https://bugs.gentoo.org/257156 Signed-off-by: Jakov Smolic <jakov.smolic@sartura.hr> Signed-off-by: David Seifert <soap@gentoo.org> profiles/arch/amd64/package.use.mask | 4 - profiles/arch/base/package.use.mask | 4 - profiles/arch/hppa/use.mask | 4 - profiles/arch/x86/package.use.mask | 4 - sys-power/pm-utils/Manifest | 1 - .../pm-utils/files/1.4.1-bluetooth-sync.patch | 43 ---------- .../pm-utils/files/1.4.1-disable-sata-alpm.patch | 24 ------ sys-power/pm-utils/files/1.4.1-echo-n.patch | 51 ------------ sys-power/pm-utils/files/1.4.1-fix-alpm-typo.patch | 29 ------- .../1.4.1-fix-intel-audio-powersave-hook.patch | 40 --------- .../pm-utils/files/1.4.1-ignore-led-failure.patch | 14 ---- .../files/1.4.1-inhibit-on-right-status.patch | 20 ----- .../pm-utils/files/1.4.1-logging-append.patch | 17 ---- .../pm-utils/files/1.4.1-run-hook-logging.patch | 17 ---- .../pm-utils/files/1.4.1-suspend-hybrid.patch | 36 --------- .../files/1.4.1-uswsusp-hibernate-mode.patch | 19 ----- .../files/1.4.1-xfs_buffer_arguments.patch | 31 ------- sys-power/pm-utils/files/pm-utils.logrotate | 8 -- sys-power/pm-utils/files/power.d/pci_devices | 61 -------------- sys-power/pm-utils/files/power.d/usb_bluetooth | 45 ----------- sys-power/pm-utils/files/sleep.d/50unload_alx | 18 ----- sys-power/pm-utils/metadata.xml | 10 --- sys-power/pm-utils/pm-utils-1.4.1-r7.ebuild | 94 ---------------------- 23 files changed, 594 deletions(-)