[v3,1/2] power: enable CPPC support in power library
Checks
Commit Message
Power library already supports Linux CPPC driver. Enable its use
and fix the name of the CPPC driver name.
Signed-off-by: Wathsala Vithanage <wathsala.vithanage@arm.com>
Reviewed-by: Dhruv Tripathi <dhruv.tripathi@arm.com>
---
lib/power/power_cppc_cpufreq.c | 2 +-
lib/power/rte_power_pmd_mgmt.c | 11 ++++++-----
2 files changed, 7 insertions(+), 6 deletions(-)
Comments
10/10/2024 16:17, Wathsala Vithanage:
> Power library already supports Linux CPPC driver. Enable its use
> and fix the name of the CPPC driver name.
>
> Signed-off-by: Wathsala Vithanage <wathsala.vithanage@arm.com>
> Reviewed-by: Dhruv Tripathi <dhruv.tripathi@arm.com>
Series applied with a little more details about being a real fix.
> > fix the name of the CPPC driver name.
> >
> > Signed-off-by: Wathsala Vithanage <wathsala.vithanage@arm.com>
> > Reviewed-by: Dhruv Tripathi <dhruv.tripathi@arm.com>
>
> Series applied with a little more details about being a real fix.
>
>
Thanks you Thomas.
@@ -36,7 +36,7 @@
#define POWER_SYSFILE_SYS_MAX \
"/sys/devices/system/cpu/cpu%u/cpufreq/cpuinfo_max_freq"
-#define POWER_CPPC_DRIVER "cppc-cpufreq"
+#define POWER_CPPC_DRIVER "cppc_cpufreq"
#define BUS_FREQ 100000
enum power_state {
@@ -419,11 +419,12 @@ check_scale(unsigned int lcore)
{
enum power_management_env env;
- /* only PSTATE and ACPI modes are supported */
+ /* only PSTATE, AMD-PSTATE, ACPI and CPPC modes are supported */
if (!rte_power_check_env_supported(PM_ENV_ACPI_CPUFREQ) &&
!rte_power_check_env_supported(PM_ENV_PSTATE_CPUFREQ) &&
- !rte_power_check_env_supported(PM_ENV_AMD_PSTATE_CPUFREQ)) {
- POWER_LOG(DEBUG, "Neither ACPI nor PSTATE modes are supported");
+ !rte_power_check_env_supported(PM_ENV_AMD_PSTATE_CPUFREQ) &&
+ !rte_power_check_env_supported(PM_ENV_CPPC_CPUFREQ)) {
+ POWER_LOG(DEBUG, "Only ACPI, PSTATE, AMD-PSTATE, or CPPC modes are supported");
return -ENOTSUP;
}
/* ensure we could initialize the power library */
@@ -433,8 +434,8 @@ check_scale(unsigned int lcore)
/* ensure we initialized the correct env */
env = rte_power_get_env();
if (env != PM_ENV_ACPI_CPUFREQ && env != PM_ENV_PSTATE_CPUFREQ &&
- env != PM_ENV_AMD_PSTATE_CPUFREQ) {
- POWER_LOG(DEBUG, "Neither ACPI nor PSTATE modes were initialized");
+ env != PM_ENV_AMD_PSTATE_CPUFREQ && env != PM_ENV_CPPC_CPUFREQ) {
+ POWER_LOG(DEBUG, "Unable to initialize ACPI, PSTATE, AMD-PSTATE, or CPPC modes");
return -ENOTSUP;
}