From 9ff3591eae51de5ff3f0e3b27df98d9282ac0a0d Mon Sep 17 00:00:00 2001 From: Zhang Rui Date: Fri, 23 Jan 2026 10:54:51 +0800 Subject: [PATCH] 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 --- BM/pstate/intel_pstate_tests.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/BM/pstate/intel_pstate_tests.sh b/BM/pstate/intel_pstate_tests.sh index e4f9eb0f..d933e9a2 100755 --- a/BM/pstate/intel_pstate_tests.sh +++ b/BM/pstate/intel_pstate_tests.sh @@ -62,6 +62,18 @@ please get it from latest upstream tools/power/x86/x86_energy_perf_policy." fi pstate_teardown() { + local online_cpu="" + + online_cpu=$(ls /sys/devices/system/cpu/cpu*/online | wc -l) + online_cpu=$(($online_cpu+1)) + test_print_trc "Total CPUs from /sys/devices/: $online_cpu" + + # Hot plug all logic CPUs except cpu0 + for ((cpu = 1; cpu < online_cpu; cpu++)); do + test_print_trc "Hot plug CPU$cpu" + echo 1 > $CPU_SYSFS_PATH/cpu$cpu/online + done + # restore pstate status and no_turbo echo "$no_turbo_value" > "$CPU_NO_TURBO_NODE" echo "$pstate_status_value" > "$CPU_PSTATE_SYSFS_PATH/status"