From: Wathsala Vithanage <wathsala.vithanage@arm.com>
To: dev@dpdk.org, Anatoly Burakov <anatoly.burakov@intel.com>,
David Hunt <david.hunt@intel.com>,
Sivaprasad Tummala <sivaprasad.tummala@amd.com>
Cc: stable@dpdk.org, Wathsala Vithanage <wathsala.vithanage@arm.com>,
Dhruv Tripathi <dhruv.tripathi@arm.com>
Subject: [PATCH v3 1/2] power: enable CPPC support in power library
Date: Thu, 10 Oct 2024 14:17:36 +0000 [thread overview]
Message-ID: <20241010141737.1135905-1-wathsala.vithanage@arm.com> (raw)
In-Reply-To: <20240906210637.630356>
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(-)
diff --git a/lib/power/power_cppc_cpufreq.c b/lib/power/power_cppc_cpufreq.c
index 32aaacb948..e68b39b424 100644
--- a/lib/power/power_cppc_cpufreq.c
+++ b/lib/power/power_cppc_cpufreq.c
@@ -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 {
diff --git a/lib/power/rte_power_pmd_mgmt.c b/lib/power/rte_power_pmd_mgmt.c
index b1c18a5f56..830a6c7a97 100644
--- a/lib/power/rte_power_pmd_mgmt.c
+++ b/lib/power/rte_power_pmd_mgmt.c
@@ -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;
}
--
2.34.1
next parent reply other threads:[~2024-10-10 14:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20240906210637.630356>
2024-10-10 14:17 ` Wathsala Vithanage [this message]
2024-10-10 14:17 ` [PATCH v3 2/2] power: detect supported driver Wathsala Vithanage
2024-10-10 21:44 ` [PATCH v3 1/2] power: enable CPPC support in power library Thomas Monjalon
2024-10-10 21:51 ` Wathsala Wathawana Vithanage
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241010141737.1135905-1-wathsala.vithanage@arm.com \
--to=wathsala.vithanage@arm.com \
--cc=anatoly.burakov@intel.com \
--cc=david.hunt@intel.com \
--cc=dev@dpdk.org \
--cc=dhruv.tripathi@arm.com \
--cc=sivaprasad.tummala@amd.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).