All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Add unit test module for AMD P-State driver
@ 2022-03-23  7:14 Meng Li
  2022-03-23  7:15 ` [PATCH 1/3] cpufreq: amd-pstate: Expose struct amd_cpudata Meng Li
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Meng Li @ 2022-03-23  7:14 UTC (permalink / raw)
  To: Shuah Khan, Rafael J . Wysocki, Huang Rui, linux-pm
  Cc: Nathan Fontenot, Deepak Sharma, Alex Deucher, Mario Limonciello,
	Jinzhou Su, Perry Yuan, Xiaojian Du, Viresh Kumar,
	Borislav Petkov, linux-kernel, Meng Li

Hi all:

AMD P-State unit test(amd-pstate-ut) is a kernel module for testing the
functions of amd-pstate.
It could import as a module to launch some test tasks.

We upstream out AMD P-state driver into Linux kernel and use this unit
test module to verify the required conditions and basic functions of
amd-pstate before integration test.

When you test all the test cases, you will get the following test results.
The status "P" is pass, "F" is fail.
jasmine@jasmine:/sys/module/amd_pstate_ut/parameters$ cat
unit_test
Index    Test cases              Status
0        stop                    [ ]
1        all                     [P]
2        x86_vendor              [P]
3        acpi_cpc_valid          [P]
4        modprobed_driver        [P]
5        capability_check        [P]
6        enable                  [P]
7        init_perf               [P]
8        support_boost           [P]
9        clear_status            [ ]
------------------------------------------
begin_index = 1 end_index= 8

For exmaple: The test case acpi_cpc_valid is used to check whether the
_CPC object is exist in SBIOS.
The amd-pstate initialization will fail if the _CPC in ACPI SBIOS is
not existed at the detected processor, so it is a necessary condition.

At present, its test cases are very simple, and the corresponding test
cases will continue to be added later to improve the test coverage.

Thanks,
Jasmine

Meng Li (3):
  cpufreq: amd-pstate: Expose struct amd_cpudata
  cpupower: Introduce a new unit test module for AMD P-State driver
  Documentation: amd-pstate: Add unit test introduction

 Documentation/admin-guide/pm/amd-pstate.rst   | 221 +++++++
 drivers/cpufreq/amd-pstate.c                  |  60 +-
 include/linux/amd-pstate.h                    |  74 +++
 tools/power/cpupower/debug/kernel/Makefile    |  10 +-
 .../cpupower/debug/kernel/amd-pstate-ut.c     | 618 ++++++++++++++++++
 5 files changed, 923 insertions(+), 60 deletions(-)
 create mode 100644 include/linux/amd-pstate.h
 create mode 100644 tools/power/cpupower/debug/kernel/amd-pstate-ut.c

-- 
2.25.1


^ permalink raw reply	[flat|nested] 9+ messages in thread
* [PATCH v2 0/3] Add unit test module for AMD P-State driver
@ 2022-04-13  9:05 Meng Li
  2022-04-13  9:05 ` [PATCH 1/3] cpufreq: amd-pstate: Expose struct amd_cpudata Meng Li
  0 siblings, 1 reply; 9+ messages in thread
From: Meng Li @ 2022-04-13  9:05 UTC (permalink / raw)
  To: Shuah Khan, Rafael J . Wysocki, Huang Rui, linux-pm
  Cc: Nathan Fontenot, Deepak Sharma, Alex Deucher, Mario Limonciello,
	Jinzhou Su, Perry Yuan, Xiaojian Du, Viresh Kumar,
	Borislav Petkov, linux-kernel, Meng Li

Hi all:

AMD P-State unit test(amd_pstate_testmod) is a kernel module for testing
the functions of amd-pstate driver.
It could import as a module to launch some test tasks.

We upstream out AMD P-state driver into Linux kernel and use this unit
test module to verify the required conditions and basic functions of
amd-pstate before integration test.

We use test module in the kselftest frameworks to implement it.
We create amd_pstate_testmod module and tie it into kselftest.

For exmaple: The test case aput_acpi_cpc is used to check whether the
_CPC object is exist in SBIOS.
The amd-pstate initialization will fail if the _CPC in ACPI SBIOS is
not existed at the detected processor, so it is a necessary condition.

At present, its test cases are very simple, and the corresponding test
cases will continue to be added later to improve the test coverage.

See patch series in below git repo:
V1: https://lore.kernel.org/linux-pm/20220323071502.2674156-1-li.meng@amd.com/

Changes from V1 -> V2:
- cpufreq: amd-pstate:
- - add a trailing of amd-pstate.h to MAINTAINER AMD PSTATE DRIVER
- selftests: cpufreq
- - add a wrapper shell script for the amd_pstate_testmod module
- selftests: cpufreq:
- - remove amd_pstate_testmod kernel module to .../cpufreq/amd_pstate_testmod
- Documentation: amd-pstate:
- - amd_pstate_testmod rst document is not provided at present.

Thanks,
Jasmine

Meng Li (3):
  cpufreq: amd-pstate: Expose struct amd_cpudata
  selftests: cpufreq: Add wapper script for test AMD P-State
  selftests: cpufreq: Add amd_pstate_testmod kernel module for testing

 MAINTAINERS                                   |   1 +
 drivers/cpufreq/amd-pstate.c                  |  60 +---
 include/linux/amd-pstate.h                    |  74 +++++
 tools/testing/selftests/cpufreq/Makefile      |   2 +-
 .../selftests/cpufreq/amd_pstate_testmod.sh   |   4 +
 .../cpufreq/amd_pstate_testmod/Makefile       |  20 ++
 .../amd_pstate_testmod/amd_pstate_testmod.c   | 302 ++++++++++++++++++
 tools/testing/selftests/cpufreq/config        |   1 +
 8 files changed, 404 insertions(+), 60 deletions(-)
 create mode 100644 include/linux/amd-pstate.h
 create mode 100755 tools/testing/selftests/cpufreq/amd_pstate_testmod.sh
 create mode 100644 tools/testing/selftests/cpufreq/amd_pstate_testmod/Makefile
 create mode 100644 tools/testing/selftests/cpufreq/amd_pstate_testmod/amd_pstate_testmod.c

-- 
2.25.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-04-17  2:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-23  7:14 [PATCH 0/3] Add unit test module for AMD P-State driver Meng Li
2022-03-23  7:15 ` [PATCH 1/3] cpufreq: amd-pstate: Expose struct amd_cpudata Meng Li
2022-03-23  7:15 ` [PATCH 2/3] cpupower: Introduce a new unit test module for AMD P-State driver Meng Li
2022-03-23 14:15   ` Shuah Khan
2022-03-28 13:57     ` Meng, Li (Jassmine)
2022-03-28 14:56       ` Shuah Khan
2022-03-23  7:15 ` [PATCH 3/3] Documentation: amd-pstate: Add unit test introduction Meng Li
2022-04-13  9:05 [PATCH v2 0/3] Add unit test module for AMD P-State driver Meng Li
2022-04-13  9:05 ` [PATCH 1/3] cpufreq: amd-pstate: Expose struct amd_cpudata Meng Li
2022-04-17  2:09   ` Huang Rui

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.