mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mario Limonciello <superm1@kernel.org>
To: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>,
	"Gautham R . Shenoy" <gautham.shenoy@amd.com>,
	Perry Yuan <perry.yuan@amd.com>
Cc: "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
	<linux-kernel@vger.kernel.org>,
	"open list:CPU FREQUENCY SCALING FRAMEWORK"
	<linux-pm@vger.kernel.org>,
	Mario Limonciello <mario.limonciello@amd.com>
Subject: Re: [PATCH v2 1/5] cpufreq/amd-pstate: Add dynamic energy performance preference
Date: Tue, 18 Mar 2025 14:08:10 -0500	[thread overview]
Message-ID: <87d34e74-46e3-45c3-8f17-baf2feb50506@kernel.org> (raw)
In-Reply-To: <182723d8-73b2-45b8-bd86-9ffdbee7130c@amd.com>

On 3/11/2025 01:34, Dhananjay Ugwekar wrote:
> On 3/4/2025 8:53 PM, Mario Limonciello wrote:
>> From: Mario Limonciello <mario.limonciello@amd.com>
>>
>> Dynamic energy performance preference will change the EPP profile
>> based on whether the machine is running on AC or DC power.
>>
>> A notification chain from the power supply core is used to adjust
>> EPP values on plug in or plug out events.
>>
>> For non-server systems:
>>      * the default EPP for AC mode is `performance`.
>>      * the default EPP for DC mode is `balance_performance`.
>>
>> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>> ---
>> v1->v2:
>>   * Change defaults to performance (AC) and balance_performance (DC)
>>   * Default Kconfig to disabled for now
>>   * Rebase on latest branch
>> ---
>>   Documentation/admin-guide/pm/amd-pstate.rst |  18 ++-
>>   drivers/cpufreq/Kconfig.x86                 |  12 ++
>>   drivers/cpufreq/amd-pstate.c                | 129 ++++++++++++++++++--
>>   drivers/cpufreq/amd-pstate.h                |   5 +-
>>   4 files changed, 155 insertions(+), 9 deletions(-)
>>
> [Snip]
>> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
>> index e98ef41083ba1..f00fb4ba9f26e 100644
>> --- a/drivers/cpufreq/amd-pstate.c
>> +++ b/drivers/cpufreq/amd-pstate.c
>> @@ -36,6 +36,7 @@
>>   #include <linux/io.h>
>>   #include <linux/delay.h>
>>   #include <linux/uaccess.h>
>> +#include <linux/power_supply.h>
>>   #include <linux/static_call.h>
>>   #include <linux/topology.h>
>>   
>> @@ -86,6 +87,7 @@ static struct cpufreq_driver amd_pstate_driver;
>>   static struct cpufreq_driver amd_pstate_epp_driver;
>>   static int cppc_state = AMD_PSTATE_UNDEFINED;
>>   static bool amd_pstate_prefcore = true;
>> +static bool dynamic_epp = CONFIG_X86_AMD_PSTATE_DYNAMIC_EPP;
> 
> Is there an #ifdef needed here? I see build error when X86_AMD_PSTATE_DYNAMIC_EPP is not set in config
> 

Ah yeah, I see the same too when I check that config.  Not sure why 
build robot didn't catch this.

Will add this for next version.

diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index dcf6e36d693f8..824756ac0010e 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -87,7 +87,11 @@ static struct cpufreq_driver amd_pstate_driver;
  static struct cpufreq_driver amd_pstate_epp_driver;
  static int cppc_state = AMD_PSTATE_UNDEFINED;
  static bool amd_pstate_prefcore = true;
+#ifdef CONFIG_X86_AMD_PSTATE_DYNAMIC_EPP
  static bool dynamic_epp = CONFIG_X86_AMD_PSTATE_DYNAMIC_EPP;
+#else
+static bool dynamic_epp = false;
+#endif
  static struct quirk_entry *quirks;

  /*

  reply	other threads:[~2025-03-18 19:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-04 15:23 [PATCH v2 0/5] amd-pstate Dynamic EPP and raw EPP Mario Limonciello
2025-03-04 15:23 ` [PATCH v2 1/5] cpufreq/amd-pstate: Add dynamic energy performance preference Mario Limonciello
2025-03-07  6:45   ` Gautham R. Shenoy
2025-03-11  6:34   ` Dhananjay Ugwekar
2025-03-18 19:08     ` Mario Limonciello [this message]
2025-03-12 12:16   ` Dhananjay Ugwekar
2025-03-18 19:36     ` Mario Limonciello
2025-03-19  3:43       ` Dhananjay Ugwekar
2025-03-19 16:50         ` Mario Limonciello
2025-03-19 17:13           ` Mario Limonciello
2025-03-04 15:23 ` [PATCH v2 2/5] cpufreq/amd-pstate: add kernel command line to override dynamic epp Mario Limonciello
2025-03-07  8:53   ` Gautham R. Shenoy
2025-03-04 15:23 ` [PATCH v2 3/5] cpufreq/amd-pstate: Add support for platform profile class Mario Limonciello
2025-03-07 16:22   ` Gautham R. Shenoy
2025-03-07 16:55     ` Mario Limonciello
2025-03-08  4:30       ` Mario Limonciello
2025-03-10  5:09         ` Gautham R. Shenoy
2025-03-18 19:07           ` Mario Limonciello
2025-03-04 15:23 ` [PATCH v2 4/5] cpufreq/amd-pstate: Add support for raw EPP writes Mario Limonciello
2025-03-04 15:23 ` [PATCH v2 5/5] cpufreq/amd-pstate-ut: Add a unit test for raw EPP Mario Limonciello

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=87d34e74-46e3-45c3-8f17-baf2feb50506@kernel.org \
    --to=superm1@kernel.org \
    --cc=Dhananjay.Ugwekar@amd.com \
    --cc=gautham.shenoy@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=perry.yuan@amd.com \
    /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

all inboxes | Powered by JetHome®