[1/7] cpufreq: amd-pstate: remove set_boost callback for passive mode

Message ID 3404e063b86a5517b70d497b066c3fdeb5d8bef3.1706255676.git.perry.yuan@amd.com
State New
Headers
Series AMD Pstate Driver Core Performance Boost |

Commit Message

Yuan, Perry Jan. 26, 2024, 8:08 a.m. UTC
  From: Perry Yuan <Perry.Yuan@amd.com>

The following patches will enable `amd-pstate` CPU boost control method
which will not need this common boost control callback anymore, so we
remove the legacy set_boost interface from amd-pstate driver.

Signed-off-by: Perry Yuan <Perry.Yuan@amd.com>
---
 drivers/cpufreq/amd-pstate.c | 26 --------------------------
 1 file changed, 26 deletions(-)
  

Comments

Mario Limonciello Jan. 26, 2024, 3:45 p.m. UTC | #1
On 1/26/2024 02:08, Perry Yuan wrote:
> From: Perry Yuan <Perry.Yuan@amd.com>
> 
> The following patches will enable `amd-pstate` CPU boost control method
When it's committed it won't be a patch.  How about instead "A specific 
amd-pstate CPU boost control method is to be introduced and the legacy 
callback doesn't make sense" or something along those lines.

Also; is the ordering correct?  In terms of bisectability should this 
come after the new one is introduced perhaps?

> which will not need this common boost control callback anymore, so we
> remove the legacy set_boost interface from amd-pstate driver.
> 
> Signed-off-by: Perry Yuan <Perry.Yuan@amd.com>
> ---
>   drivers/cpufreq/amd-pstate.c | 26 --------------------------
>   1 file changed, 26 deletions(-)
> 
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index 9a1e194d5cf8..8f308f56ade6 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -632,31 +632,6 @@ static int amd_get_lowest_nonlinear_freq(struct amd_cpudata *cpudata)
>   	return lowest_nonlinear_freq * 1000;
>   }
>   
> -static int amd_pstate_set_boost(struct cpufreq_policy *policy, int state)
> -{
> -	struct amd_cpudata *cpudata = policy->driver_data;
> -	int ret;
> -
> -	if (!cpudata->boost_supported) {
> -		pr_err("Boost mode is not supported by this processor or SBIOS\n");
> -		return -EINVAL;
> -	}
> -
> -	if (state)
> -		policy->cpuinfo.max_freq = cpudata->max_freq;
> -	else
> -		policy->cpuinfo.max_freq = cpudata->nominal_freq;
> -
> -	policy->max = policy->cpuinfo.max_freq;
> -
> -	ret = freq_qos_update_request(&cpudata->req[1],
> -				      policy->cpuinfo.max_freq);
> -	if (ret < 0)
> -		return ret;
> -
> -	return 0;
> -}
> -
>   static void amd_pstate_boost_init(struct amd_cpudata *cpudata)
>   {
>   	u32 highest_perf, nominal_perf;
> @@ -1391,7 +1366,6 @@ static struct cpufreq_driver amd_pstate_driver = {
>   	.exit		= amd_pstate_cpu_exit,
>   	.suspend	= amd_pstate_cpu_suspend,
>   	.resume		= amd_pstate_cpu_resume,
> -	.set_boost	= amd_pstate_set_boost,
>   	.name		= "amd-pstate",
>   	.attr		= amd_pstate_attr,
>   };
  
Yuan, Perry Jan. 29, 2024, 4:46 a.m. UTC | #2
[AMD Official Use Only - General]

Hi Mario,

> -----Original Message-----
> From: Limonciello, Mario <Mario.Limonciello@amd.com>
> Sent: Friday, January 26, 2024 11:45 PM
> To: Yuan, Perry <Perry.Yuan@amd.com>; rafael.j.wysocki@intel.com;
> viresh.kumar@linaro.org; Huang, Ray <Ray.Huang@amd.com>; Shenoy,
> Gautham Ranjal <gautham.shenoy@amd.com>; Petkov, Borislav
> <Borislav.Petkov@amd.com>
> Cc: Deucher, Alexander <Alexander.Deucher@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-
> kernel@vger.kernel.org
> Subject: Re: [PATCH 1/7] cpufreq: amd-pstate: remove set_boost callback for
> passive mode
>
> On 1/26/2024 02:08, Perry Yuan wrote:
> > From: Perry Yuan <Perry.Yuan@amd.com>
> >
> > The following patches will enable `amd-pstate` CPU boost control
> > method
> When it's committed it won't be a patch.  How about instead "A specific amd-
> pstate CPU boost control method is to be introduced and the legacy callback
> doesn't make sense" or something along those lines.
>
> Also; is the ordering correct?  In terms of bisectability should this come after
> the new one is introduced perhaps?

I move the patch to the end of the series and update the commit info like you suggested.
Thank you for the feedback.

Regards.
Perry

>
> > which will not need this common boost control callback anymore, so we
> > remove the legacy set_boost interface from amd-pstate driver.
> >
> > Signed-off-by: Perry Yuan <Perry.Yuan@amd.com>
> > ---
> >   drivers/cpufreq/amd-pstate.c | 26 --------------------------
> >   1 file changed, 26 deletions(-)
> >
> > diff --git a/drivers/cpufreq/amd-pstate.c
> > b/drivers/cpufreq/amd-pstate.c index 9a1e194d5cf8..8f308f56ade6
> 100644
> > --- a/drivers/cpufreq/amd-pstate.c
> > +++ b/drivers/cpufreq/amd-pstate.c
> > @@ -632,31 +632,6 @@ static int amd_get_lowest_nonlinear_freq(struct
> amd_cpudata *cpudata)
> >     return lowest_nonlinear_freq * 1000;
> >   }
> >
> > -static int amd_pstate_set_boost(struct cpufreq_policy *policy, int
> > state) -{
> > -   struct amd_cpudata *cpudata = policy->driver_data;
> > -   int ret;
> > -
> > -   if (!cpudata->boost_supported) {
> > -           pr_err("Boost mode is not supported by this processor or
> SBIOS\n");
> > -           return -EINVAL;
> > -   }
> > -
> > -   if (state)
> > -           policy->cpuinfo.max_freq = cpudata->max_freq;
> > -   else
> > -           policy->cpuinfo.max_freq = cpudata->nominal_freq;
> > -
> > -   policy->max = policy->cpuinfo.max_freq;
> > -
> > -   ret = freq_qos_update_request(&cpudata->req[1],
> > -                                 policy->cpuinfo.max_freq);
> > -   if (ret < 0)
> > -           return ret;
> > -
> > -   return 0;
> > -}
> > -
> >   static void amd_pstate_boost_init(struct amd_cpudata *cpudata)
> >   {
> >     u32 highest_perf, nominal_perf;
> > @@ -1391,7 +1366,6 @@ static struct cpufreq_driver amd_pstate_driver =
> {
> >     .exit           = amd_pstate_cpu_exit,
> >     .suspend        = amd_pstate_cpu_suspend,
> >     .resume         = amd_pstate_cpu_resume,
> > -   .set_boost      = amd_pstate_set_boost,
> >     .name           = "amd-pstate",
> >     .attr           = amd_pstate_attr,
> >   };
  

Patch

diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index 9a1e194d5cf8..8f308f56ade6 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -632,31 +632,6 @@  static int amd_get_lowest_nonlinear_freq(struct amd_cpudata *cpudata)
 	return lowest_nonlinear_freq * 1000;
 }
 
-static int amd_pstate_set_boost(struct cpufreq_policy *policy, int state)
-{
-	struct amd_cpudata *cpudata = policy->driver_data;
-	int ret;
-
-	if (!cpudata->boost_supported) {
-		pr_err("Boost mode is not supported by this processor or SBIOS\n");
-		return -EINVAL;
-	}
-
-	if (state)
-		policy->cpuinfo.max_freq = cpudata->max_freq;
-	else
-		policy->cpuinfo.max_freq = cpudata->nominal_freq;
-
-	policy->max = policy->cpuinfo.max_freq;
-
-	ret = freq_qos_update_request(&cpudata->req[1],
-				      policy->cpuinfo.max_freq);
-	if (ret < 0)
-		return ret;
-
-	return 0;
-}
-
 static void amd_pstate_boost_init(struct amd_cpudata *cpudata)
 {
 	u32 highest_perf, nominal_perf;
@@ -1391,7 +1366,6 @@  static struct cpufreq_driver amd_pstate_driver = {
 	.exit		= amd_pstate_cpu_exit,
 	.suspend	= amd_pstate_cpu_suspend,
 	.resume		= amd_pstate_cpu_resume,
-	.set_boost	= amd_pstate_set_boost,
 	.name		= "amd-pstate",
 	.attr		= amd_pstate_attr,
 };