Revert "When stopping powerd, set the CPU frequency back to its maximum value"

This reverts commit 1dcb6ad173.

As of "8cb16fdbea6b Restore original frequency on exit.", powerd
restores the original frequency itself.

Further, if the original frequency is not the same as the
first frequency found in the frequency list, then the restoration
done by the powerd_poststop will restore the wrong frequency.
This can happen on Intel machines where Turbo is not enabled,
but the turbo frequency is first in the list of frequencies.
In this case, turbo will be enabled when the user did not want
it to be.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D40197
Reviewed by: imp, mav
This commit is contained in:
Andrew Gallatin 2023-05-21 20:47:28 -04:00
parent 430d064ba5
commit fd96685a4a

View File

@ -14,13 +14,6 @@ name="powerd"
desc="Modify the power profile based on AC line state"
rcvar="powerd_enable"
command="/usr/sbin/${name}"
stop_postcmd=powerd_poststop
powerd_poststop()
{
sysctl dev.cpu.0.freq=`sysctl -n dev.cpu.0.freq_levels |
sed -e 's:/.*::'` > /dev/null
}
load_rc_config $name
run_rc_command "$1"