Skip to contentSkip to conversation

Add explanation for

PATCH In review Meng Li 2 participants 3 messages Sep 5, 2022 – Sep 7, 2022

Subsystems (2)
lore
Share & tools
lore

Meng Li

author
#0 lore raw

v2 cover Add explanation for

Hi all:

According to Shuah's review comments, add a new patches for expain X86_AMD_PSTATE_UT.

amd-pstate-ut can also be built-in without X86_AMD_PSTATE enabled. Currently, only tests for amd-pstate are supported. If X86_AMD_PSTATE is set disabled, it can tell the users test can only run on amd-pstate driver, please set X86_AMD_PSTATE enabled.
In the future, comparison tests will be added. It can set amd-pstate disabled and set acpi-cpufreq enabled to run test cases, then compare the test results.

See patch series in below git repo:
V1:https://lore.kernel.org/lkml/[email protected]/

Changes from V1->V2:
- cpufreq: amd-pstate:
- - Modify explanation for X86_AMD_PSTATE_UT.
- selftests: amd-pstate:
- - Add prompt information when X86_AMD_PSTATE is set disabled.

Thanks,
Jasmine

Meng Li (1):
cpufreq: amd-pstate: Add explanation for X86_AMD_PSTATE_UT

 drivers/cpufreq/Kconfig.x86                         | 12 +++++++-----
 tools/testing/selftests/amd-pstate/amd-pstate-ut.sh |  1 +
 2 files changed, 8 insertions(+), 5 deletions(-)
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v2 1/1 cpufreq: amd-pstate: Add explanation for X86_AMD_PSTATE_UT

This kernel module is used for testing. It's safe to say M here. It can also be built-in without X86_AMD_PSTATE enabled. Currently, only tests for amd-pstate are supported. If X86_AMD_PSTATE is set disabled, it can tell the users test can only run on amd-pstate driver, please set X86_AMD_PSTATE enabled.
In the future, comparison tests will be added. It can set amd-pstate disabled and set acpi-cpufreq enabled to run test cases, then compare the test results.

---
 drivers/cpufreq/Kconfig.x86                         | 12 +++++++-----
 tools/testing/selftests/amd-pstate/amd-pstate-ut.sh |  1 +
 2 files changed, 8 insertions(+), 5 deletions(-)
drivers/cpufreq/Kconfig.x86 +7 -5
index fd1582716c58..310779b07daf 100644
@@ -58,11 +58,13 @@ config X86_AMD_PSTATE_UT
 	help
 	  This kernel module is used for testing. It's safe to say M here.
 
-	  It can be modprobed even without amd-pstate module.
-	  When the comparison test is performed, it can load other module
-	  like acpi-cpufreq to test cases, then compare the test results.
-	  When only the test for amd-pstate is performed, it can tell the
-	  users they loaded a wrong module like acpi-cpufreq.
+	  It can also be built-in without X86_AMD_PSTATE enabled.
+	  Currently, only tests for amd-pstate are supported. If X86_AMD_PSTATE
+	  is set disabled, it can tell the users test can only run on amd-pstate
+	  driver, please set X86_AMD_PSTATE enabled.
+	  In the future, comparison tests will be added. It can set amd-pstate
+	  disabled and set acpi-cpufreq enabled to run test cases, then compare
+	  the test results.
 
 config X86_ACPI_CPUFREQ
 	tristate "ACPI Processor P-States driver"
tools/testing/selftests/amd-pstate/amd-pstate-ut.sh +1 -0
index 273364650285..f8e82d91ffcf 100755
@@ -32,6 +32,7 @@ fi
 scaling_driver=$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_driver)
 if [ "$scaling_driver" != "amd-pstate" ]; then
 	echo "$0 # Skipped: Test can only run on amd-pstate driver."
+	echo "$0 # Please set X86_AMD_PSTATE enabled."
 	echo "$0 # Current cpufreq scaling drvier is $scaling_driver."
 	exit $ksft_skip
 fi
Signature · 1 line
2.34.1
maintainer
#2 lore raw

Re: [Suggested-by:Shuah Khan Patch V2 1/1] cpufreq: amd-pstate: Add explanation for X86_AMD_PSTATE_UT

Quoted 43 lines · Meng Li

This kernel module is used for testing. It's safe to say M here. It can also be built-in without X86_AMD_PSTATE enabled. Currently, only tests for amd-pstate are supported. If X86_AMD_PSTATE is set disabled, it can tell the users test can only run on amd-pstate driver, please set X86_AMD_PSTATE enabled.
In the future, comparison tests will be added. It can set amd-pstate disabled and set acpi-cpufreq enabled to run test cases, then compare the test results.

---
  drivers/cpufreq/Kconfig.x86                         | 12 +++++++-----
  tools/testing/selftests/amd-pstate/amd-pstate-ut.sh |  1 +
  2 files changed, 8 insertions(+), 5 deletions(-)
drivers/cpufreq/Kconfig.x86 +7 -5
index fd1582716c58..310779b07daf 100644
@@ -58,11 +58,13 @@ config X86_AMD_PSTATE_UT
  	help
  	  This kernel module is used for testing. It's safe to say M here.
 
-	  It can be modprobed even without amd-pstate module.
-	  When the comparison test is performed, it can load other module
-	  like acpi-cpufreq to test cases, then compare the test results.
-	  When only the test for amd-pstate is performed, it can tell the
-	  users they loaded a wrong module like acpi-cpufreq.
+	  It can also be built-in without X86_AMD_PSTATE enabled.
+	  Currently, only tests for amd-pstate are supported. If X86_AMD_PSTATE
+	  is set disabled, it can tell the users test can only run on amd-pstate
+	  driver, please set X86_AMD_PSTATE enabled.
+	  In the future, comparison tests will be added. It can set amd-pstate
+	  disabled and set acpi-cpufreq enabled to run test cases, then compare
+	  the test results.
 
  config X86_ACPI_CPUFREQ
  	tristate "ACPI Processor P-States driver"
tools/testing/selftests/amd-pstate/amd-pstate-ut.sh +0 -0
index 273364650285..f8e82d91ffcf 100755

tools/testing/selftests/amd-pstate/amd-pstate-ut.sh fi · line 38

Quoted 7 lines
tools/testing/selftests/amd-pstate/amd-pstate-ut.sh +1 -0
@@ -32,6 +32,7 @@ fi
  scaling_driver=$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_driver)
  if [ "$scaling_driver" != "amd-pstate" ]; then
  	echo "$0 # Skipped: Test can only run on amd-pstate driver."
+	echo "$0 # Please set X86_AMD_PSTATE enabled."
  	echo "$0 # Current cpufreq scaling drvier is $scaling_driver."
  	exit $ksft_skip
  fi

This patch doesn't apply on top of the previous patch series in linux-kselftest next - please rebase and resend the patch.

thanks,
-- Shuah