basic.sh 1.1 KB

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