1a2fa60eeSMeng Li#!/bin/sh 2a2fa60eeSMeng Li# SPDX-License-Identifier: GPL-2.0 3a2fa60eeSMeng Li 4a2fa60eeSMeng Li# amd-pstate-ut is a test module for testing the amd-pstate driver. 5a2fa60eeSMeng Li# It can only run on x86 architectures and current cpufreq driver 6a2fa60eeSMeng Li# must be amd-pstate. 7a2fa60eeSMeng Li# (1) It can help all users to verify their processor support 8a2fa60eeSMeng Li# (SBIOS/Firmware or Hardware). 9a2fa60eeSMeng Li# (2) Kernel can have a basic function test to avoid the kernel 10a2fa60eeSMeng Li# regression during the update. 11a2fa60eeSMeng Li# (3) We can introduce more functional or performance tests to align 12a2fa60eeSMeng Li# the result together, it will benefit power and performance scale optimization. 13a2fa60eeSMeng Li 14*e5df3268SMeng Li# protect against multiple inclusion 15*e5df3268SMeng Liif [ $FILE_BASIC ]; then 16*e5df3268SMeng Li return 0 17*e5df3268SMeng Lielse 18*e5df3268SMeng Li FILE_BASIC=DONE 19a2fa60eeSMeng Lifi 20a2fa60eeSMeng Li 21*e5df3268SMeng Liamd_pstate_basic() 22*e5df3268SMeng Li{ 23*e5df3268SMeng Li printf "\n---------------------------------------------\n" 24*e5df3268SMeng Li printf "*** Running AMD P-state ut ***" 25*e5df3268SMeng Li printf "\n---------------------------------------------\n" 26a2fa60eeSMeng Li 27a2fa60eeSMeng Li if ! /sbin/modprobe -q -n amd-pstate-ut; then 28a2fa60eeSMeng Li echo "amd-pstate-ut: module amd-pstate-ut is not found [SKIP]" 29a2fa60eeSMeng Li exit $ksft_skip 30a2fa60eeSMeng Li fi 31a2fa60eeSMeng Li if /sbin/modprobe -q amd-pstate-ut; then 32a2fa60eeSMeng Li /sbin/modprobe -q -r amd-pstate-ut 33*e5df3268SMeng Li echo "amd-pstate-basic: ok" 34a2fa60eeSMeng Li else 35*e5df3268SMeng Li echo "amd-pstate-basic: [FAIL]" 36a2fa60eeSMeng Li exit 1 37a2fa60eeSMeng Li fi 38*e5df3268SMeng Li} 39