Commit 9d2dbd3d authored by Dmytro Maluka's avatar Dmytro Maluka Committed by Shuah Khan
Browse files

selftests/cpu-hotplug: Fix check for cpu hotplug not supported



If CONFIG_HOTPLUG_CPU is disabled, /sys/devices/system/cpu/cpu*
directories are still populated, so the test fails to correctly detect
that CPU hotplug is not supported.

Fix this by checking for the presence of 'online' files in those
directories instead. The 'online' node is created for the given CPU if
and only if this CPU supports hotplug. So if none of the CPUs have
'online' nodes, it means CPU hotplug is not supported.

Signed-off-by: default avatarDmytro Maluka <dmaluka@chromium.org>
Link: https://lore.kernel.org/r/20260319153825.2813576-1-dmaluka@chromium.org


Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 64fac990
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ prerequisite()
		exit $ksft_skip
	fi

	if ! ls $SYSFS/devices/system/cpu/cpu* > /dev/null 2>&1; then
	if ! ls $SYSFS/devices/system/cpu/cpu*/online > /dev/null 2>&1; then
		echo $msg cpu hotplug is not supported >&2
		exit $ksft_skip
	fi