Path: blob/master/tools/testing/selftests/amd-pstate/basic.sh
26285 views
#!/bin/sh1# SPDX-License-Identifier: GPL-2.023# amd-pstate-ut is a test module for testing the amd-pstate driver.4# It can only run on x86 architectures and current cpufreq driver5# must be amd-pstate.6# (1) It can help all users to verify their processor support7# (SBIOS/Firmware or Hardware).8# (2) Kernel can have a basic function test to avoid the kernel9# regression during the update.10# (3) We can introduce more functional or performance tests to align11# the result together, it will benefit power and performance scale optimization.1213# protect against multiple inclusion14if [ $FILE_BASIC ]; then15return 016else17FILE_BASIC=DONE18fi1920amd_pstate_basic()21{22printf "\n---------------------------------------------\n"23printf "*** Running AMD P-state ut ***"24printf "\n---------------------------------------------\n"2526if ! /sbin/modprobe -q -n amd-pstate-ut; then27echo "amd-pstate-ut: module amd-pstate-ut is not found [SKIP]"28exit $ksft_skip29fi30if /sbin/modprobe -q amd-pstate-ut; then31/sbin/modprobe -q -r amd-pstate-ut32echo "amd-pstate-basic: ok"33else34echo "amd-pstate-basic: [FAIL]"35exit 136fi37}383940