[v3,6/7] cpufreq: amd-pstate: remove legacy set_boost callback for passive mode

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

Commit Message

Yuan, Perry Feb. 7, 2024, 9:21 a.m. UTC
  With new freqency boost interface supported, legacy boost control
doesn't make sense any more which only support passive mode.
so it can remove the legacy set_boost interface from amd-pstate driver
in case of there is conflict with new boost control logic.

Signed-off-by: Perry Yuan <perry.yuan@amd.com>
---
 drivers/cpufreq/amd-pstate.c | 1 -
 include/linux/amd-pstate.h   | 1 -
 2 files changed, 2 deletions(-)
  

Comments

Oleksandr Natalenko Feb. 7, 2024, 10:10 a.m. UTC | #1
Hello.

On středa 7. února 2024 10:21:57 CET Perry Yuan wrote:
> With new freqency boost interface supported, legacy boost control
> doesn't make sense any more which only support passive mode.
> so it can remove the legacy set_boost interface from amd-pstate driver
> in case of there is conflict with new boost control logic.
> 
> Signed-off-by: Perry Yuan <perry.yuan@amd.com>
> ---
>  drivers/cpufreq/amd-pstate.c | 1 -
>  include/linux/amd-pstate.h   | 1 -
>  2 files changed, 2 deletions(-)
> 
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index 35791efc6e88..1dd523db3871 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -1675,7 +1675,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,
>  	.update_limits	= amd_pstate_update_limits,
>  	.name		= "amd-pstate",
>  	.attr		= amd_pstate_attr,
> diff --git a/include/linux/amd-pstate.h b/include/linux/amd-pstate.h
> index 465e9295a60c..ab7ca26974da 100644
> --- a/include/linux/amd-pstate.h
> +++ b/include/linux/amd-pstate.h
> @@ -93,7 +93,6 @@ struct amd_cpudata {
>  	struct amd_aperf_mperf prev;
>  
>  	u64	freq;
> -	bool	boost_supported;

As a result of this removal the kernel-doc for this struct should be amended too because even after this patch is applied the `boost_supported` field remains documented.

>  	bool	hw_prefcore;
>  
>  	/* EPP feature related attributes*/
>
  
Yuan, Perry Feb. 7, 2024, 1:17 p.m. UTC | #2
[AMD Official Use Only - General]

Hi,

> -----Original Message-----
> From: Oleksandr Natalenko <oleksandr@natalenko.name>
> Sent: Wednesday, February 7, 2024 6:11 PM
> To: rafael.j.wysocki@intel.com; Limonciello, Mario
> <Mario.Limonciello@amd.com>; viresh.kumar@linaro.org; Huang, Ray
> <Ray.Huang@amd.com>; Shenoy, Gautham Ranjal
> <gautham.shenoy@amd.com>; Petkov, Borislav
> <Borislav.Petkov@amd.com>; Yuan, Perry <Perry.Yuan@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 v3 6/7] cpufreq: amd-pstate: remove legacy set_boost
> callback for passive mode
>
> Hello.
>
> On středa 7. února 2024 10:21:57 CET Perry Yuan wrote:
> > With new freqency boost interface supported, legacy boost control
> > doesn't make sense any more which only support passive mode.
> > so it can remove the legacy set_boost interface from amd-pstate driver
> > in case of there is conflict with new boost control logic.
> >
> > Signed-off-by: Perry Yuan <perry.yuan@amd.com>
> > ---
> >  drivers/cpufreq/amd-pstate.c | 1 -
> >  include/linux/amd-pstate.h   | 1 -
> >  2 files changed, 2 deletions(-)
> >
> > diff --git a/drivers/cpufreq/amd-pstate.c
> > b/drivers/cpufreq/amd-pstate.c index 35791efc6e88..1dd523db3871
> 100644
> > --- a/drivers/cpufreq/amd-pstate.c
> > +++ b/drivers/cpufreq/amd-pstate.c
> > @@ -1675,7 +1675,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,
> >     .update_limits  = amd_pstate_update_limits,
> >     .name           = "amd-pstate",
> >     .attr           = amd_pstate_attr,
> > diff --git a/include/linux/amd-pstate.h b/include/linux/amd-pstate.h
> > index 465e9295a60c..ab7ca26974da 100644
> > --- a/include/linux/amd-pstate.h
> > +++ b/include/linux/amd-pstate.h
> > @@ -93,7 +93,6 @@ struct amd_cpudata {
> >     struct amd_aperf_mperf prev;
> >
> >     u64     freq;
> > -   bool    boost_supported;
>
> As a result of this removal the kernel-doc for this struct should be amended
> too because even after this patch is applied the `boost_supported` field
> remains documented.

The set_boost is callback used by cpufreq.c, the boost_supported is not documented before the patch.
We just need to add new sysfs "cpb_boost" introduction in the "/Documentation/admin-guide/pm/amd-pstate.rst"
The legacy boost is not supported any more, we have no need to document it again as it is.

Perry.

>
> >     bool    hw_prefcore;
> >
> >     /* EPP feature related attributes*/
> >
>
>
> --
> Oleksandr Natalenko (post-factum)
  
Oleksandr Natalenko Feb. 7, 2024, 1:27 p.m. UTC | #3
On středa 7. února 2024 14:17:06 CET Yuan, Perry wrote:
> [AMD Official Use Only - General]
> 
> Hi,
> 
> > -----Original Message-----
> > From: Oleksandr Natalenko <oleksandr@natalenko.name>
> > Sent: Wednesday, February 7, 2024 6:11 PM
> > To: rafael.j.wysocki@intel.com; Limonciello, Mario
> > <Mario.Limonciello@amd.com>; viresh.kumar@linaro.org; Huang, Ray
> > <Ray.Huang@amd.com>; Shenoy, Gautham Ranjal
> > <gautham.shenoy@amd.com>; Petkov, Borislav
> > <Borislav.Petkov@amd.com>; Yuan, Perry <Perry.Yuan@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 v3 6/7] cpufreq: amd-pstate: remove legacy set_boost
> > callback for passive mode
> >
> > Hello.
> >
> > On středa 7. února 2024 10:21:57 CET Perry Yuan wrote:
> > > With new freqency boost interface supported, legacy boost control
> > > doesn't make sense any more which only support passive mode.
> > > so it can remove the legacy set_boost interface from amd-pstate driver
> > > in case of there is conflict with new boost control logic.
> > >
> > > Signed-off-by: Perry Yuan <perry.yuan@amd.com>
> > > ---
> > >  drivers/cpufreq/amd-pstate.c | 1 -
> > >  include/linux/amd-pstate.h   | 1 -
> > >  2 files changed, 2 deletions(-)
> > >
> > > diff --git a/drivers/cpufreq/amd-pstate.c
> > > b/drivers/cpufreq/amd-pstate.c index 35791efc6e88..1dd523db3871
> > 100644
> > > --- a/drivers/cpufreq/amd-pstate.c
> > > +++ b/drivers/cpufreq/amd-pstate.c
> > > @@ -1675,7 +1675,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,
> > >     .update_limits  = amd_pstate_update_limits,
> > >     .name           = "amd-pstate",
> > >     .attr           = amd_pstate_attr,
> > > diff --git a/include/linux/amd-pstate.h b/include/linux/amd-pstate.h
> > > index 465e9295a60c..ab7ca26974da 100644
> > > --- a/include/linux/amd-pstate.h
> > > +++ b/include/linux/amd-pstate.h
> > > @@ -93,7 +93,6 @@ struct amd_cpudata {
> > >     struct amd_aperf_mperf prev;
> > >
> > >     u64     freq;
> > > -   bool    boost_supported;
> >
> > As a result of this removal the kernel-doc for this struct should be amended
> > too because even after this patch is applied the `boost_supported` field
> > remains documented.
> 
> The set_boost is callback used by cpufreq.c, the boost_supported is not documented before the patch.
> We just need to add new sysfs "cpb_boost" introduction in the "/Documentation/admin-guide/pm/amd-pstate.rst"
> The legacy boost is not supported any more, we have no need to document it again as it is.

`boost_supported` as a field of `struct amd_cpudata` is documented in the kernel-doc right before the structure, and this bit should be removed like shown below:

```
--- a/include/linux/amd-pstate.h
+++ b/include/linux/amd-pstate.h
@@ -56,7 +56,6 @@ struct amd_aperf_mperf {
  * @cur: Difference of Aperf/Mperf/tsc count between last and current sample
  * @prev: Last Aperf/Mperf/tsc count value read from register
  * @freq: current cpu frequency value
- * @boost_supported: check whether the Processor or SBIOS supports boost mode
  * @hw_prefcore: check whether HW supports preferred core featue.
  * 		  Only when hw_prefcore and early prefcore param are true,
  * 		  AMD P-State driver supports preferred core featue.

```

> Perry.
> 
> >
> > >     bool    hw_prefcore;
> > >
> > >     /* EPP feature related attributes*/
> > >
> >
> >
> > --
> > Oleksandr Natalenko (post-factum)
>
  
Yuan, Perry Feb. 7, 2024, 1:35 p.m. UTC | #4
[AMD Official Use Only - General]

> -----Original Message-----
> From: Oleksandr Natalenko <oleksandr@natalenko.name>
> Sent: Wednesday, February 7, 2024 9:27 PM
> To: rafael.j.wysocki@intel.com; Limonciello, Mario
> <Mario.Limonciello@amd.com>; viresh.kumar@linaro.org; Huang, Ray
> <Ray.Huang@amd.com>; Shenoy, Gautham Ranjal
> <gautham.shenoy@amd.com>; Petkov, Borislav
> <Borislav.Petkov@amd.com>; Yuan, Perry <Perry.Yuan@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 v3 6/7] cpufreq: amd-pstate: remove legacy set_boost
> callback for passive mode
>
> On středa 7. února 2024 14:17:06 CET Yuan, Perry wrote:
> > [AMD Official Use Only - General]
> >
> > Hi,
> >
> > > -----Original Message-----
> > > From: Oleksandr Natalenko <oleksandr@natalenko.name>
> > > Sent: Wednesday, February 7, 2024 6:11 PM
> > > To: rafael.j.wysocki@intel.com; Limonciello, Mario
> > > <Mario.Limonciello@amd.com>; viresh.kumar@linaro.org; Huang, Ray
> > > <Ray.Huang@amd.com>; Shenoy, Gautham Ranjal
> > > <gautham.shenoy@amd.com>; Petkov, Borislav
> > > <Borislav.Petkov@amd.com>; Yuan, Perry <Perry.Yuan@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 v3 6/7] cpufreq: amd-pstate: remove legacy
> > > set_boost callback for passive mode
> > >
> > > Hello.
> > >
> > > On středa 7. února 2024 10:21:57 CET Perry Yuan wrote:
> > > > With new freqency boost interface supported, legacy boost control
> > > > doesn't make sense any more which only support passive mode.
> > > > so it can remove the legacy set_boost interface from amd-pstate
> > > > driver in case of there is conflict with new boost control logic.
> > > >
> > > > Signed-off-by: Perry Yuan <perry.yuan@amd.com>
> > > > ---
> > > >  drivers/cpufreq/amd-pstate.c | 1 -
> > > >  include/linux/amd-pstate.h   | 1 -
> > > >  2 files changed, 2 deletions(-)
> > > >
> > > > diff --git a/drivers/cpufreq/amd-pstate.c
> > > > b/drivers/cpufreq/amd-pstate.c index 35791efc6e88..1dd523db3871
> > > 100644
> > > > --- a/drivers/cpufreq/amd-pstate.c
> > > > +++ b/drivers/cpufreq/amd-pstate.c
> > > > @@ -1675,7 +1675,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,
> > > >     .update_limits  = amd_pstate_update_limits,
> > > >     .name           = "amd-pstate",
> > > >     .attr           = amd_pstate_attr,
> > > > diff --git a/include/linux/amd-pstate.h
> > > > b/include/linux/amd-pstate.h index 465e9295a60c..ab7ca26974da
> > > > 100644
> > > > --- a/include/linux/amd-pstate.h
> > > > +++ b/include/linux/amd-pstate.h
> > > > @@ -93,7 +93,6 @@ struct amd_cpudata {
> > > >     struct amd_aperf_mperf prev;
> > > >
> > > >     u64     freq;
> > > > -   bool    boost_supported;
> > >
> > > As a result of this removal the kernel-doc for this struct should be
> > > amended too because even after this patch is applied the
> > > `boost_supported` field remains documented.
> >
> > The set_boost is callback used by cpufreq.c, the boost_supported is not
> documented before the patch.
> > We just need to add new sysfs "cpb_boost" introduction in the
> "/Documentation/admin-guide/pm/amd-pstate.rst"
> > The legacy boost is not supported any more, we have no need to
> document it again as it is.
>
> `boost_supported` as a field of `struct amd_cpudata` is documented in the
> kernel-doc right before the structure, and this bit should be removed like
> shown below:

You mean the comment in the amd-pstate.h, right?
I misunderstood that you are referring to amd-pstate.rst Doc.
The comment is removed from v4, will send it out after other feedback collected.
Thanks for the review!

Perry.

- * @boost_supported: check whether the Processor or SBIOS supports
> boost mode

>
> ```
> --- a/include/linux/amd-pstate.h
> +++ b/include/linux/amd-pstate.h
> @@ -56,7 +56,6 @@ struct amd_aperf_mperf {
>   * @cur: Difference of Aperf/Mperf/tsc count between last and current
> sample
>   * @prev: Last Aperf/Mperf/tsc count value read from register
>   * @freq: current cpu frequency value
> - * @boost_supported: check whether the Processor or SBIOS supports
> boost mode
>   * @hw_prefcore: check whether HW supports preferred core featue.
>   *             Only when hw_prefcore and early prefcore param are true,
>   *             AMD P-State driver supports preferred core featue.
>
> ```
>
> > Perry.
> >
> > >
> > > >     bool    hw_prefcore;
> > > >
> > > >     /* EPP feature related attributes*/
> > > >
> > >
> > >
> > > --
> > > Oleksandr Natalenko (post-factum)
> >
>
>
> --
> Oleksandr Natalenko (post-factum)
  

Patch

diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index 35791efc6e88..1dd523db3871 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -1675,7 +1675,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,
 	.update_limits	= amd_pstate_update_limits,
 	.name		= "amd-pstate",
 	.attr		= amd_pstate_attr,
diff --git a/include/linux/amd-pstate.h b/include/linux/amd-pstate.h
index 465e9295a60c..ab7ca26974da 100644
--- a/include/linux/amd-pstate.h
+++ b/include/linux/amd-pstate.h
@@ -93,7 +93,6 @@  struct amd_cpudata {
 	struct amd_aperf_mperf prev;
 
 	u64	freq;
-	bool	boost_supported;
 	bool	hw_prefcore;
 
 	/* EPP feature related attributes*/