39 lines · bash
1#!/bin/sh2# SPDX-License-Identifier: GPL-2.03 4# amd-pstate-ut is a test module for testing the amd-pstate driver.5# It can only run on x86 architectures and current cpufreq driver6# must be amd-pstate.7# (1) It can help all users to verify their processor support8# (SBIOS/Firmware or Hardware).9# (2) Kernel can have a basic function test to avoid the kernel10# regression during the update.11# (3) We can introduce more functional or performance tests to align12# the result together, it will benefit power and performance scale optimization.13 14# protect against multiple inclusion15if [ $FILE_BASIC ]; then16 return 017else18 FILE_BASIC=DONE19fi20 21amd_pstate_basic()22{23 printf "\n---------------------------------------------\n"24 printf "*** Running AMD P-state ut ***"25 printf "\n---------------------------------------------\n"26 27 if ! /sbin/modprobe -q -n amd-pstate-ut; then28 echo "amd-pstate-ut: module amd-pstate-ut is not found [SKIP]"29 exit $ksft_skip30 fi31 if /sbin/modprobe -q amd-pstate-ut; then32 /sbin/modprobe -q -r amd-pstate-ut33 echo "amd-pstate-basic: ok"34 else35 echo "amd-pstate-basic: [FAIL]"36 exit 137 fi38}39