From: Huang Rui <ray.huang@amd.com>
To: "Jain, Ayush" <Ayush.Jain3@amd.com>
Cc: "rafael@kernel.org" <rafael@kernel.org>,
"viresh.kumar@linaro.org" <viresh.kumar@linaro.org>,
"Yuan, Perry" <Perry.Yuan@amd.com>,
"Karny, Wyes" <Wyes.Karny@amd.com>,
"Limonciello, Mario" <Mario.Limonciello@amd.com>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RESEND PATCH] amd-pstate: Only print supported epp values for performance governor
Date: Fri, 3 Nov 2023 17:59:58 +0800 [thread overview]
Message-ID: <ZUTEnneqNcosb/1R@amd.com> (raw)
In-Reply-To: <20231103094815.16141-1-ayush.jain3@amd.com>
On Fri, Nov 03, 2023 at 05:48:15PM +0800, Jain, Ayush wrote:
> show_energy_performance_available_preferences() to show only supported
> values which is performance in performance governor policy.
>
> -------Before--------
> $ cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_driver
> amd-pstate-epp
> $ cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
> performance
> $ cat /sys/devices/system/cpu/cpu1/cpufreq/energy_performance_preference
> performance
> $ cat /sys/devices/system/cpu/cpu1/cpufreq/energy_performance_available_preferences
> default performance balance_performance balance_power power
>
> -------After--------
> $ cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_driver
> amd-pstate-epp
> $ cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
> performance
> $ cat /sys/devices/system/cpu/cpu1/cpufreq/energy_performance_preference
> performance
> $ cat /sys/devices/system/cpu/cpu1/cpufreq/energy_performance_available_preferences
> performance
>
> Fixes: ffa5096a7c33 ("cpufreq: amd-pstate: implement Pstate EPP support for the AMD processors")
>
> Suggested-by: Wyes Karny <wyes.karny@amd.com>
> Signed-off-by: Ayush Jain <ayush.jain3@amd.com>
> Reviewed-by: Wyes Karny <wyes.karny@amd.com>
Nice catch, thanks for the fix.
Acked-by: Huang Rui <ray.huang@amd.com>
>
> ---
> drivers/cpufreq/amd-pstate.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index 9a1e194d5cf8..e6c5a57662e4 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -850,11 +850,16 @@ static ssize_t show_energy_performance_available_preferences(
> {
> int i = 0;
> int offset = 0;
> + struct amd_cpudata *cpudata = policy->driver_data;
> +
> + if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE)
> + return sysfs_emit_at(buf, offset, "%s\n",
> + energy_perf_strings[EPP_INDEX_PERFORMANCE]);
>
> while (energy_perf_strings[i] != NULL)
> offset += sysfs_emit_at(buf, offset, "%s ", energy_perf_strings[i++]);
>
> - sysfs_emit_at(buf, offset, "\n");
> + offset += sysfs_emit_at(buf, offset, "\n");
>
> return offset;
> }
> --
> 2.34.1
>
next prev parent reply other threads:[~2023-11-03 10:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-03 9:48 [RESEND PATCH] amd-pstate: Only print supported epp values for performance governor Ayush Jain
2023-11-03 9:59 ` Huang Rui [this message]
2023-11-29 21:06 ` Rafael J. Wysocki
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=ZUTEnneqNcosb/1R@amd.com \
--to=ray.huang@amd.com \
--cc=Ayush.Jain3@amd.com \
--cc=Mario.Limonciello@amd.com \
--cc=Perry.Yuan@amd.com \
--cc=Wyes.Karny@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.