Skip to content

Commit 9ff3591

Browse files
committed
Hotplug CPUs in pstate teardown callback
pstate testcase may offline CPUs. Make sure all offlined CPUs are onlined in teardown callback. Signed-off-by: Zhang Rui <rui.zhang@intel.com>
1 parent 13f523e commit 9ff3591

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

BM/pstate/intel_pstate_tests.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ please get it from latest upstream tools/power/x86/x86_energy_perf_policy."
6262
fi
6363

6464
pstate_teardown() {
65+
local online_cpu=""
66+
67+
online_cpu=$(ls /sys/devices/system/cpu/cpu*/online | wc -l)
68+
online_cpu=$(($online_cpu+1))
69+
test_print_trc "Total CPUs from /sys/devices/: $online_cpu"
70+
71+
# Hot plug all logic CPUs except cpu0
72+
for ((cpu = 1; cpu < online_cpu; cpu++)); do
73+
test_print_trc "Hot plug CPU$cpu"
74+
echo 1 > $CPU_SYSFS_PATH/cpu$cpu/online
75+
done
76+
6577
# restore pstate status and no_turbo
6678
echo "$no_turbo_value" > "$CPU_NO_TURBO_NODE"
6779
echo "$pstate_status_value" > "$CPU_PSTATE_SYSFS_PATH/status"

0 commit comments

Comments
 (0)