public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Gautham R. Shenoy" <gautham.shenoy@amd.com>
To: "Mario Limonciello (AMD)" <superm1@kernel.org>
Cc: Perry Yuan <perry.yuan@amd.com>,
	"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>
Subject: Re: [PATCH v6 4/5] cpufreq/amd-pstate: Add support for raw EPP writes
Date: Tue, 31 Mar 2026 22:40:48 +0530	[thread overview]
Message-ID: <acwAGPB/38cv2oB7@BLRRASHENOY1.amd.com> (raw)
In-Reply-To: <20260329203811.2590633-5-superm1@kernel.org>

On Sun, Mar 29, 2026 at 03:38:10PM -0500, Mario Limonciello (AMD) wrote:
> The energy performance preference field of the CPPC request MSR
> supports values from 0 to 255, but the strings only offer 4 values.
> 
> The other values are useful for tuning the performance of some
> workloads.
> 
> Add support for writing the raw energy performance preference value
> to the sysfs file.  If the last value written was an integer then
> an integer will be returned.  If the last value written was a string
> then a string will be returned.
> 
> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
> ---
> v5->v6:
>  * Move the raw EPP parsing and readback changes into this patch
>  * Use the kernel bool literal `false` for the raw EPP tracking flag
> ---
>  Documentation/admin-guide/pm/amd-pstate.rst | 16 ++++++---
>  drivers/cpufreq/amd-pstate.c                | 36 +++++++++++++++------
>  drivers/cpufreq/amd-pstate.h                |  1 +
>  3 files changed, 38 insertions(+), 15 deletions(-)
> 
> diff --git a/Documentation/admin-guide/pm/amd-pstate.rst b/Documentation/admin-guide/pm/amd-pstate.rst
> index 2d92c8072b83c..6ff2b477f0472 100644
> --- a/Documentation/admin-guide/pm/amd-pstate.rst
> +++ b/Documentation/admin-guide/pm/amd-pstate.rst
> @@ -316,16 +316,22 @@ A list of all the supported EPP preferences that could be used for
>  These profiles represent different hints that are provided
>  to the low-level firmware about the user's desired energy vs efficiency
>  tradeoff.  ``default`` represents the epp value is set by platform
> -firmware. This attribute is read-only.
> +firmware. ``custom`` designates that integer values 0-255 may be written
> +as well.  This attribute is read-only.
>  
>  ``energy_performance_preference``
>  
>  The current energy performance preference can be read from this attribute.
>  and user can change current preference according to energy or performance needs
> -Please get all support profiles list from
> -``energy_performance_available_preferences`` attribute, all the profiles are
> -integer values defined between 0 to 255 when EPP feature is enabled by platform
> -firmware, but if the dynamic EPP feature is enabled, driver will block writes.
> +Coarse named profiles are available in the attribute
> +``energy_performance_available_preferences``.
> +Users can also write individual integer values between 0 to 255.
> +When EPP feature is enabled by platform firmware but if the dynamic EPP feature is
> +enabled, driver will ignore the written value.

Driver isn't ignoring the written value. In this patchset,
store_energy_performance_preference() returns an -EBUSY when the
userspace writes a value to the energy_performance_preference sysfs
file with dynamic EPP enabled.

     if (cpudata->dynamic_epp) {
     		pr_debug("EPP cannot be set when dynamic EPP is enabled\n");
		return -EBUSY;
     }

So, can the last line needs to be reworded as

"When dynamic EPP is enabled, writes to energy_performance_preference
are blocked even when EPP feature is enabled by platform firmware." ?

Otherwise the patch looks good to me.

Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>

-- 
Thanks and Regards
gautham.

  reply	other threads:[~2026-03-31 17:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-29 20:38 [PATCH v6 0/5] amd-pstate Dynamic EPP and raw EPP Mario Limonciello (AMD)
2026-03-29 20:38 ` [PATCH v6 1/5] cpufreq/amd-pstate: Add dynamic energy performance preference Mario Limonciello (AMD)
2026-03-31 16:59   ` Gautham R. Shenoy
2026-03-29 20:38 ` [PATCH v6 2/5] cpufreq/amd-pstate: add kernel command line to override dynamic epp Mario Limonciello (AMD)
2026-03-31 17:01   ` Gautham R. Shenoy
2026-03-29 20:38 ` [PATCH v6 3/5] cpufreq/amd-pstate: Add support for platform profile class Mario Limonciello (AMD)
2026-03-31 17:02   ` Gautham R. Shenoy
2026-03-29 20:38 ` [PATCH v6 4/5] cpufreq/amd-pstate: Add support for raw EPP writes Mario Limonciello (AMD)
2026-03-31 17:10   ` Gautham R. Shenoy [this message]
2026-03-31 18:48     ` Mario Limonciello
2026-03-29 20:38 ` [PATCH v6 5/5] cpufreq/amd-pstate-ut: Add a unit test for raw EPP Mario Limonciello (AMD)
2026-03-31 17:17   ` Gautham R. Shenoy

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=acwAGPB/38cv2oB7@BLRRASHENOY1.amd.com \
    --to=gautham.shenoy@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=perry.yuan@amd.com \
    --cc=superm1@kernel.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