From: Huang Rui <ray.huang@amd.com>
To: "Yuan, Perry" <Perry.Yuan@amd.com>
Cc: "rafael.j.wysocki@intel.com" <rafael.j.wysocki@intel.com>,
"viresh.kumar@linaro.org" <viresh.kumar@linaro.org>,
"Limonciello, Mario" <Mario.Limonciello@amd.com>,
"Sharma, Deepak" <Deepak.Sharma@amd.com>,
"Karny, Wyes" <Wyes.Karny@amd.com>,
"Shenoy, Gautham Ranjal" <gautham.shenoy@amd.com>,
"Li, Sun peng (Leo)" <Sunpeng.Li@amd.com>,
"Huang, Shimmer" <Shimmer.Huang@amd.com>,
"Du, Xiaojian" <Xiaojian.Du@amd.com>,
"Meng, Li (Jassmine)" <Li.Meng@amd.com>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/4] cpufreq: amd-pstate: Set a fallback policy based on preferred_profile
Date: Tue, 20 Jun 2023 22:58:14 +0800 [thread overview]
Message-ID: <ZJG+Xhun1Ltw9ox/@amd.com> (raw)
In-Reply-To: <20230615063225.4029929-1-perry.yuan@amd.com>
On Thu, Jun 15, 2023 at 02:32:25PM +0800, Yuan, Perry wrote:
> From: Mario Limonciello <mario.limonciello@amd.com>
>
> If a user's configuration doesn't explicitly specify the cpufreq
> scaling governor then the code currently explicitly falls back to
> 'powersave'. This default is fine for notebooks and desktops, but
May I know if the processor is powerful desktop such as threadripper,
whether it will be default to 'performance' or 'powersave'?
Thanks,
Ray
> servers and undefined machines should default to 'performance'.
>
> Look at the 'preferred_profile' field from the FADT to set this
> policy accordingly.
>
> Link: https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/05_ACPI_Software_Programming_Model/ACPI_Software_Programming_Model.html#fixed-acpi-description-table-fadt
> Suggested-by: Wyes Karny <Wyes.Karny@amd.com>
> Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
> drivers/cpufreq/amd-pstate.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index ddd346a239e0..c9d296ebf81e 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -1102,10 +1102,13 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy)
> policy->max = policy->cpuinfo.max_freq;
>
> /*
> - * Set the policy to powersave to provide a valid fallback value in case
> + * Set the policy to provide a valid fallback value in case
> * the default cpufreq governor is neither powersave nor performance.
> */
> - policy->policy = CPUFREQ_POLICY_POWERSAVE;
> + if (acpi_pm_profile_server() || acpi_pm_profile_undefined())
> + policy->policy = CPUFREQ_POLICY_PERFORMANCE;
> + else
> + policy->policy = CPUFREQ_POLICY_POWERSAVE;
>
> if (boot_cpu_has(X86_FEATURE_CPPC)) {
> ret = rdmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, &value);
> --
> 2.34.1
>
next prev parent reply other threads:[~2023-06-20 14:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-15 6:32 [PATCH v2 2/4] cpufreq: amd-pstate: Set a fallback policy based on preferred_profile Perry Yuan
2023-06-20 14:58 ` Huang Rui [this message]
2023-06-20 15:02 ` Limonciello, Mario
2023-06-20 15:06 ` Huang Rui
2023-06-20 15:18 ` Limonciello, Mario
2023-06-20 15:36 ` Huang Rui
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=ZJG+Xhun1Ltw9ox/@amd.com \
--to=ray.huang@amd.com \
--cc=Deepak.Sharma@amd.com \
--cc=Li.Meng@amd.com \
--cc=Mario.Limonciello@amd.com \
--cc=Perry.Yuan@amd.com \
--cc=Shimmer.Huang@amd.com \
--cc=Sunpeng.Li@amd.com \
--cc=Wyes.Karny@amd.com \
--cc=Xiaojian.Du@amd.com \
--cc=gautham.shenoy@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=viresh.kumar@linaro.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).