All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 4/4] cpufreq: intel_pstate: Use the acpi_pm_profile_server() symbol
@ 2023-06-15  6:33 Perry Yuan
  2023-06-15 15:57 ` Rafael J. Wysocki
  0 siblings, 1 reply; 4+ messages in thread
From: Perry Yuan @ 2023-06-15  6:33 UTC (permalink / raw)
  To: rafael.j.wysocki, viresh.kumar, Ray.Huang, Mario.Limonciello
  Cc: Deepak.Sharma, Wyes.Karny, gautham.shenoy, Sunpeng.Li,
	Xinmei.Huang, Xiaojian.Du, Li.Meng, linux-pm, linux-kernel

From: Mario Limonciello <mario.limonciello@amd.com>

Avoid duplication of functionality by using the generic symbol.
This does have a functional change that intel-pstate will now
match "SOHO server" as well.

Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Perry Yuan <Perry.Yuan@amd.com>
---
 drivers/cpufreq/intel_pstate.c | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 2548ec92faa2..6401338971c7 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -313,18 +313,9 @@ static DEFINE_MUTEX(intel_pstate_limits_lock);
 
 #ifdef CONFIG_ACPI
 
-static bool intel_pstate_acpi_pm_profile_server(void)
-{
-	if (acpi_gbl_FADT.preferred_profile == PM_ENTERPRISE_SERVER ||
-	    acpi_gbl_FADT.preferred_profile == PM_PERFORMANCE_SERVER)
-		return true;
-
-	return false;
-}
-
 static bool intel_pstate_get_ppc_enable_status(void)
 {
-	if (intel_pstate_acpi_pm_profile_server())
+	if (acpi_pm_profile_server())
 		return true;
 
 	return acpi_ppc;
@@ -481,10 +472,6 @@ static inline void intel_pstate_exit_perf_limits(struct cpufreq_policy *policy)
 {
 }
 
-static inline bool intel_pstate_acpi_pm_profile_server(void)
-{
-	return false;
-}
 #endif /* CONFIG_ACPI */
 
 #ifndef CONFIG_ACPI_CPPC_LIB
@@ -2407,8 +2394,10 @@ static int intel_pstate_init_cpu(unsigned int cpunum)
 		if (hwp_active) {
 			intel_pstate_hwp_enable(cpu);
 
-			if (intel_pstate_acpi_pm_profile_server())
+#ifdef CONFIG_ACPI
+			if (acpi_pm_profile_server())
 				hwp_boost = true;
+#endif
 		}
 	} else if (hwp_active) {
 		/*
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 4/4] cpufreq: intel_pstate: Use the acpi_pm_profile_server() symbol
  2023-06-15  6:33 [PATCH v2 4/4] cpufreq: intel_pstate: Use the acpi_pm_profile_server() symbol Perry Yuan
@ 2023-06-15 15:57 ` Rafael J. Wysocki
  2023-06-19  2:53   ` Mario Limonciello
  0 siblings, 1 reply; 4+ messages in thread
From: Rafael J. Wysocki @ 2023-06-15 15:57 UTC (permalink / raw)
  To: Perry Yuan
  Cc: rafael.j.wysocki, viresh.kumar, Ray.Huang, Mario.Limonciello,
	Deepak.Sharma, Wyes.Karny, gautham.shenoy, Sunpeng.Li,
	Xinmei.Huang, Xiaojian.Du, Li.Meng, linux-pm, linux-kernel

On Thu, Jun 15, 2023 at 8:35 AM Perry Yuan <perry.yuan@amd.com> wrote:
>
> From: Mario Limonciello <mario.limonciello@amd.com>
>
> Avoid duplication of functionality by using the generic symbol.
> This does have a functional change that intel-pstate will now
> match "SOHO server" as well.

And why do you think that it is a good idea to change this behavior?

> Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> Signed-off-by: Perry Yuan <Perry.Yuan@amd.com>
> ---
>  drivers/cpufreq/intel_pstate.c | 19 ++++---------------
>  1 file changed, 4 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
> index 2548ec92faa2..6401338971c7 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -313,18 +313,9 @@ static DEFINE_MUTEX(intel_pstate_limits_lock);
>
>  #ifdef CONFIG_ACPI
>
> -static bool intel_pstate_acpi_pm_profile_server(void)
> -{
> -       if (acpi_gbl_FADT.preferred_profile == PM_ENTERPRISE_SERVER ||
> -           acpi_gbl_FADT.preferred_profile == PM_PERFORMANCE_SERVER)
> -               return true;
> -
> -       return false;
> -}
> -
>  static bool intel_pstate_get_ppc_enable_status(void)
>  {
> -       if (intel_pstate_acpi_pm_profile_server())
> +       if (acpi_pm_profile_server())
>                 return true;
>
>         return acpi_ppc;
> @@ -481,10 +472,6 @@ static inline void intel_pstate_exit_perf_limits(struct cpufreq_policy *policy)
>  {
>  }
>
> -static inline bool intel_pstate_acpi_pm_profile_server(void)
> -{
> -       return false;
> -}
>  #endif /* CONFIG_ACPI */
>
>  #ifndef CONFIG_ACPI_CPPC_LIB
> @@ -2407,8 +2394,10 @@ static int intel_pstate_init_cpu(unsigned int cpunum)
>                 if (hwp_active) {
>                         intel_pstate_hwp_enable(cpu);
>
> -                       if (intel_pstate_acpi_pm_profile_server())
> +#ifdef CONFIG_ACPI
> +                       if (acpi_pm_profile_server())
>                                 hwp_boost = true;
> +#endif
>                 }
>         } else if (hwp_active) {
>                 /*
> --
> 2.34.1
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 4/4] cpufreq: intel_pstate: Use the acpi_pm_profile_server() symbol
  2023-06-15 15:57 ` Rafael J. Wysocki
@ 2023-06-19  2:53   ` Mario Limonciello
  2023-06-20  9:23     ` Rafael J. Wysocki
  0 siblings, 1 reply; 4+ messages in thread
From: Mario Limonciello @ 2023-06-19  2:53 UTC (permalink / raw)
  To: Rafael J. Wysocki, Perry Yuan
  Cc: rafael.j.wysocki, viresh.kumar, Ray.Huang, Deepak.Sharma,
	Wyes.Karny, gautham.shenoy, Sunpeng.Li, Xinmei.Huang,
	Xiaojian.Du, Li.Meng, linux-pm, linux-kernel

On 6/15/23 10:57, Rafael J. Wysocki wrote:
> On Thu, Jun 15, 2023 at 8:35 AM Perry Yuan <perry.yuan@amd.com> wrote:
>>
>> From: Mario Limonciello <mario.limonciello@amd.com>
>>
>> Avoid duplication of functionality by using the generic symbol.
>> This does have a functional change that intel-pstate will now
>> match "SOHO server" as well.
> 
> And why do you think that it is a good idea to change this behavior?

The idea was to cover all possible server types. It seemed that it could 
be an oversight that it wasn't included initially.

Is that not the case and it is "intentionally" not including "SOHO server"?

> 
>> Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
>> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>> Signed-off-by: Perry Yuan <Perry.Yuan@amd.com>
>> ---
>>   drivers/cpufreq/intel_pstate.c | 19 ++++---------------
>>   1 file changed, 4 insertions(+), 15 deletions(-)
>>
>> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
>> index 2548ec92faa2..6401338971c7 100644
>> --- a/drivers/cpufreq/intel_pstate.c
>> +++ b/drivers/cpufreq/intel_pstate.c
>> @@ -313,18 +313,9 @@ static DEFINE_MUTEX(intel_pstate_limits_lock);
>>
>>   #ifdef CONFIG_ACPI
>>
>> -static bool intel_pstate_acpi_pm_profile_server(void)
>> -{
>> -       if (acpi_gbl_FADT.preferred_profile == PM_ENTERPRISE_SERVER ||
>> -           acpi_gbl_FADT.preferred_profile == PM_PERFORMANCE_SERVER)
>> -               return true;
>> -
>> -       return false;
>> -}
>> -
>>   static bool intel_pstate_get_ppc_enable_status(void)
>>   {
>> -       if (intel_pstate_acpi_pm_profile_server())
>> +       if (acpi_pm_profile_server())
>>                  return true;
>>
>>          return acpi_ppc;
>> @@ -481,10 +472,6 @@ static inline void intel_pstate_exit_perf_limits(struct cpufreq_policy *policy)
>>   {
>>   }
>>
>> -static inline bool intel_pstate_acpi_pm_profile_server(void)
>> -{
>> -       return false;
>> -}
>>   #endif /* CONFIG_ACPI */
>>
>>   #ifndef CONFIG_ACPI_CPPC_LIB
>> @@ -2407,8 +2394,10 @@ static int intel_pstate_init_cpu(unsigned int cpunum)
>>                  if (hwp_active) {
>>                          intel_pstate_hwp_enable(cpu);
>>
>> -                       if (intel_pstate_acpi_pm_profile_server())
>> +#ifdef CONFIG_ACPI
>> +                       if (acpi_pm_profile_server())
>>                                  hwp_boost = true;
>> +#endif
>>                  }
>>          } else if (hwp_active) {
>>                  /*
>> --
>> 2.34.1
>>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 4/4] cpufreq: intel_pstate: Use the acpi_pm_profile_server() symbol
  2023-06-19  2:53   ` Mario Limonciello
@ 2023-06-20  9:23     ` Rafael J. Wysocki
  0 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2023-06-20  9:23 UTC (permalink / raw)
  To: Mario Limonciello
  Cc: Rafael J. Wysocki, Perry Yuan, rafael.j.wysocki, viresh.kumar,
	Ray.Huang, Deepak.Sharma, Wyes.Karny, gautham.shenoy, Sunpeng.Li,
	Xinmei.Huang, Xiaojian.Du, Li.Meng, linux-pm, linux-kernel

On Mon, Jun 19, 2023 at 4:53 AM Mario Limonciello
<mario.limonciello@amd.com> wrote:
>
> On 6/15/23 10:57, Rafael J. Wysocki wrote:
> > On Thu, Jun 15, 2023 at 8:35 AM Perry Yuan <perry.yuan@amd.com> wrote:
> >>
> >> From: Mario Limonciello <mario.limonciello@amd.com>
> >>
> >> Avoid duplication of functionality by using the generic symbol.
> >> This does have a functional change that intel-pstate will now
> >> match "SOHO server" as well.
> >
> > And why do you think that it is a good idea to change this behavior?
>
> The idea was to cover all possible server types. It seemed that it could
> be an oversight that it wasn't included initially.
>
> Is that not the case and it is "intentionally" not including "SOHO server"?

Yes, it is.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-20  9:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-15  6:33 [PATCH v2 4/4] cpufreq: intel_pstate: Use the acpi_pm_profile_server() symbol Perry Yuan
2023-06-15 15:57 ` Rafael J. Wysocki
2023-06-19  2:53   ` Mario Limonciello
2023-06-20  9:23     ` Rafael J. Wysocki

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.