The CPUFreq_Validation test validates the CPU frequency scaling capabilities of a system using the Linux cpufreq subsystem. It verifies the ability to set and reflect CPU frequencies across shared policy domains (e.g., clusters of CPUs sharing frequency control).
This test is designed to be SoC-agnostic, supporting platforms with per-policy frequency management (e.g., Qualcomm SoCs with policy0, policy4, etc.).
- Ensure all cpufreq policies are present and functional
- Iterate through all available frequencies and validate correct scaling
- Ensure that CPU governors can be set to
userspace - Provide robust reporting per policy (e.g.,
CPU0-3 [via policy0] = PASS) - Avoid flaky failures in CI by using retries and proper checks
- Kernel must be built with
CONFIG_CPU_FREQandCONFIG_CPU_FREQ_GOV_USERSPACE sysfsaccess to/sys/devices/system/cpu/cpufreq/*- Root privileges (to write to cpufreq entries)
Runner/suites/Kernel/FunctionalArea/baseport/CPUFreq_Validation/run.sh
run.sh- Main test scriptCPUFreq_Validation.res- Summary result file with PASS/FAILCPUFreq_Validation.log- Full execution log (generated if logging is enabled)
- The script detects all cpufreq policies under
/sys/devices/system/cpu/cpufreq/ - For each policy:
- Reads the list of related CPUs
- Attempts to set each available frequency using the
userspacegovernor - Verifies that the frequency was correctly applied
- The result is logged per policy
- The overall test passes only if all policies succeed
[INFO] CPU0-3 [via policy0] = PASS
[FAIL] CPU4-6 [via policy4] = FAIL
[INFO] CPU7 [via policy7] = PASS
0— All policies passed1— One or more policies failed
- Can be run standalone or via LAVA
- Result file
CPUFreq_Validation.reswill be parsed byresult_parse.sh
- Some CPUs may share frequency domains, so per-core testing is not reliable
- The test includes retries to reduce false failures due to transient conditions
SPDX-License-Identifier: BSD-3-Clause(c) Qualcomm Technologies, Inc. and/or its subsidiaries.