Skip to content

Commit 8f6dad8

Browse files
committed
修正amd_pstate处理
1 parent ea6e1e9 commit 8f6dad8

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

backend/sh_tools.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,16 +136,15 @@ function set_cpu_boost()
136136
{
137137
boost=$1
138138
boost_path="/sys/devices/system/cpu/cpufreq/boost"
139-
amd_pstate_path="/sys/devices/system/cpu/amd_pstate/status"
139+
amd_pstate_path="/sys/devices/system/cpu/amd_pstate/status"\
140+
141+
if [ -f "${amd_pstate_path}" ]; then
142+
echo "passive" > "${amd_pstate_path}"
143+
fi
144+
140145
if (($boost == 1)); then
141146
echo 1 > "${boost_path}"
142-
if [ -f "${amd_pstate_path}" ]; then
143-
echo "active" > "${amd_pstate_path}"
144-
fi
145147
else
146-
if [ -f "${amd_pstate_path}" ]; then
147-
echo "passive" > "${amd_pstate_path}"
148-
fi
149148
echo 1 > "${boost_path}"
150149
echo 0 > "${boost_path}"
151150
fi

0 commit comments

Comments
 (0)