diff mbox series

[4/4] cpufreq/amd-pstate: Drop needless EPP initialization

Message ID 20241012174519.897-4-mario.limonciello@amd.com (mailing list archive)
State Accepted, archived
Delegated to: Mario Limonciello
Headers show
Series [1/4] cpufreq/amd-pstate: Use nominal perf for limits when boost is disabled | expand

Commit Message

Mario Limonciello Oct. 12, 2024, 5:45 p.m. UTC
The EPP value doesn't need to be cached to the CPPC request in
amd_pstate_epp_update_limit() because it's passed as an argument
at the end to amd_pstate_set_epp() and stored at that time.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/cpufreq/amd-pstate.c | 6 ------
 1 file changed, 6 deletions(-)

Comments

Dhananjay Ugwekar Oct. 15, 2024, 9:07 a.m. UTC | #1
Hello Mario,

On 10/12/2024 11:15 PM, Mario Limonciello wrote:
> The EPP value doesn't need to be cached to the CPPC request in
> amd_pstate_epp_update_limit() because it's passed as an argument
> at the end to amd_pstate_set_epp() and stored at that time.
> 

Tested this on an AMD Zen4 EPYC server system, ran some sanity tests, 
both modes (active and passive) seem to be working fine with the boost 
disabled and enabled.

You may add,
Tested-by: Dhananjay Ugwekar <dhananjay.ugwekar@amd.com>

Regards,
Dhananjay

> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
>  drivers/cpufreq/amd-pstate.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index 8d2541f2c74b..90868c8b214e 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -1528,12 +1528,6 @@ static int amd_pstate_epp_update_limit(struct cpufreq_policy *policy)
>  	if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE)
>  		epp = 0;
>  
> -	/* Set initial EPP value */
> -	if (cpu_feature_enabled(X86_FEATURE_CPPC)) {
> -		value &= ~GENMASK_ULL(31, 24);
> -		value |= (u64)epp << 24;
> -	}
> -
>  	WRITE_ONCE(cpudata->cppc_req_cached, value);
>  	return amd_pstate_set_epp(cpudata, epp);
>  }
Yuan, Perry Oct. 16, 2024, 4:33 a.m. UTC | #2
[Public]

> -----Original Message-----
> From: Limonciello, Mario <Mario.Limonciello@amd.com>
> Sent: Sunday, October 13, 2024 1:45 AM
> To: Shenoy, Gautham Ranjal <gautham.shenoy@amd.com>
> Cc: Yuan, Perry <Perry.Yuan@amd.com>; linux-kernel@vger.kernel.org; linux-
> pm@vger.kernel.org; Ugwekar, Dhananjay <Dhananjay.Ugwekar@amd.com>;
> Limonciello, Mario <Mario.Limonciello@amd.com>
> Subject: [PATCH 4/4] cpufreq/amd-pstate: Drop needless EPP initialization
>
> The EPP value doesn't need to be cached to the CPPC request in
> amd_pstate_epp_update_limit() because it's passed as an argument at the end to
> amd_pstate_set_epp() and stored at that time.
>
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
>  drivers/cpufreq/amd-pstate.c | 6 ------
>  1 file changed, 6 deletions(-)
>
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index
> 8d2541f2c74b..90868c8b214e 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -1528,12 +1528,6 @@ static int amd_pstate_epp_update_limit(struct
> cpufreq_policy *policy)
>       if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE)
>               epp = 0;
>
> -     /* Set initial EPP value */
> -     if (cpu_feature_enabled(X86_FEATURE_CPPC)) {
> -             value &= ~GENMASK_ULL(31, 24);
> -             value |= (u64)epp << 24;
> -     }
> -
>       WRITE_ONCE(cpudata->cppc_req_cached, value);
>       return amd_pstate_set_epp(cpudata, epp);  }
> --
> 2.43.0

LGTM, thanks.

Reviewed-by: Perry Yuan <perry.yuan@amd.com>
Gautham R. Shenoy Oct. 16, 2024, 10:33 a.m. UTC | #3
On Sat, Oct 12, 2024 at 12:45:19PM -0500, Mario Limonciello wrote:
> The EPP value doesn't need to be cached to the CPPC request in
> amd_pstate_epp_update_limit() because it's passed as an argument
> at the end to amd_pstate_set_epp() and stored at that time.
> 
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>

Thanks for cleaning it up.

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

--
Thanks and Regards
gautham.

> ---
>  drivers/cpufreq/amd-pstate.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index 8d2541f2c74b..90868c8b214e 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -1528,12 +1528,6 @@ static int amd_pstate_epp_update_limit(struct cpufreq_policy *policy)
>  	if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE)
>  		epp = 0;
>  
> -	/* Set initial EPP value */
> -	if (cpu_feature_enabled(X86_FEATURE_CPPC)) {
> -		value &= ~GENMASK_ULL(31, 24);
> -		value |= (u64)epp << 24;
> -	}
> -
>  	WRITE_ONCE(cpudata->cppc_req_cached, value);
>  	return amd_pstate_set_epp(cpudata, epp);
>  }
> -- 
> 2.43.0
>
diff mbox series

Patch

diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index 8d2541f2c74b..90868c8b214e 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -1528,12 +1528,6 @@  static int amd_pstate_epp_update_limit(struct cpufreq_policy *policy)
 	if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE)
 		epp = 0;
 
-	/* Set initial EPP value */
-	if (cpu_feature_enabled(X86_FEATURE_CPPC)) {
-		value &= ~GENMASK_ULL(31, 24);
-		value |= (u64)epp << 24;
-	}
-
 	WRITE_ONCE(cpudata->cppc_req_cached, value);
 	return amd_pstate_set_epp(cpudata, epp);
 }