As a workaround, I created a post-resume script that runs the above commands at /lib/systemd/system-sleep/throttle-workaround. It works in the first scenario, but not if the full power cycle was done on battery power.
#!/bin/sh
# Action script to prevent CPU throttling after resume.
set -e
PATH=/sbin:/usr/sbin:/bin:/usr/bin
case "${1}" in
post)
x86_energy_perf_policy --turbo-enable 1
cpufreq-set -r --max=3.0GHz
;;
esac
As a workaround, I created a post-resume script that runs the above commands at /lib/systemd/ system- sleep/throttle- workaround. It works in the first scenario, but not if the full power cycle was done on battery power.
#!/bin/sh
# Action script to prevent CPU throttling after resume.
set -e
PATH=/sbin: /usr/sbin: /bin:/usr/ bin
case "${1}" in perf_policy --turbo-enable 1
post)
x86_energy_
cpufreq-set -r --max=3.0GHz
;;
esac