Skip to content

Commit

Permalink
修正amd_pstate处理
Browse files Browse the repository at this point in the history
  • Loading branch information
honjow committed Sep 14, 2023
1 parent ea6e1e9 commit 8f6dad8
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions backend/sh_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,15 @@ function set_cpu_boost()
{
boost=$1
boost_path="/sys/devices/system/cpu/cpufreq/boost"
amd_pstate_path="/sys/devices/system/cpu/amd_pstate/status"
amd_pstate_path="/sys/devices/system/cpu/amd_pstate/status"\

if [ -f "${amd_pstate_path}" ]; then
echo "passive" > "${amd_pstate_path}"
fi

if (($boost == 1)); then
echo 1 > "${boost_path}"
if [ -f "${amd_pstate_path}" ]; then
echo "active" > "${amd_pstate_path}"
fi
else
if [ -f "${amd_pstate_path}" ]; then
echo "passive" > "${amd_pstate_path}"
fi
echo 1 > "${boost_path}"
echo 0 > "${boost_path}"
fi
Expand Down

0 comments on commit 8f6dad8

Please sign in to comment.