public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86/amd: pmf: Fix missing hidden options for Smart PC
@ 2025-03-06  3:44 Mario Limonciello
  2025-03-06  4:11 ` Shyam Sundar S K
  2025-03-10 17:19 ` Ilpo Järvinen
  0 siblings, 2 replies; 5+ messages in thread
From: Mario Limonciello @ 2025-03-06  3:44 UTC (permalink / raw)
  To: Shyam Sundar S K, Rafael J . Wysocki, Hans de Goede,
	Ilpo Järvinen, Luke D . Jones, Mark Pearson
  Cc: open list:AMD PMF DRIVER, open list, open list:ACPI,
	Derek J . Clark, Antheas Kapenekakis, me, Denis Benato,
	Mario Limonciello, Yijun Shen

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

amd_pmf_get_slider_info() checks the current profile to report correct
value to the TA inputs.  If hidden options are in use then the wrong
values will be reported to TA.

Add the two compat options PLATFORM_PROFILE_BALANCED_PERFORMANCE and
PLATFORM_PROFILE_QUIET for this use.

Reported-by: Yijun Shen <Yijun.Shen@dell.com>
Fixes: 9a43102daf64d ("platform/x86/amd: pmf: Add balanced-performance to hidden choices")
Fixes: 44e94fece5170 ("platform/x86/amd: pmf: Add 'quiet' to hidden choices")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/platform/x86/amd/pmf/spc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/platform/x86/amd/pmf/spc.c b/drivers/platform/x86/amd/pmf/spc.c
index f34f3130c3307..1d90f9382024b 100644
--- a/drivers/platform/x86/amd/pmf/spc.c
+++ b/drivers/platform/x86/amd/pmf/spc.c
@@ -219,12 +219,14 @@ static int amd_pmf_get_slider_info(struct amd_pmf_dev *dev, struct ta_pmf_enact_
 
 	switch (dev->current_profile) {
 	case PLATFORM_PROFILE_PERFORMANCE:
+	case PLATFORM_PROFILE_BALANCED_PERFORMANCE:
 		val = TA_BEST_PERFORMANCE;
 		break;
 	case PLATFORM_PROFILE_BALANCED:
 		val = TA_BETTER_PERFORMANCE;
 		break;
 	case PLATFORM_PROFILE_LOW_POWER:
+	case PLATFORM_PROFILE_QUIET:
 		val = TA_BEST_BATTERY;
 		break;
 	default:
-- 
2.43.0


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

* Re: [PATCH] platform/x86/amd: pmf: Fix missing hidden options for Smart PC
  2025-03-06  3:44 [PATCH] platform/x86/amd: pmf: Fix missing hidden options for Smart PC Mario Limonciello
@ 2025-03-06  4:11 ` Shyam Sundar S K
  2025-03-10 17:19 ` Ilpo Järvinen
  1 sibling, 0 replies; 5+ messages in thread
From: Shyam Sundar S K @ 2025-03-06  4:11 UTC (permalink / raw)
  To: Mario Limonciello, Rafael J . Wysocki, Hans de Goede,
	Ilpo Järvinen, Luke D . Jones, Mark Pearson
  Cc: open list:AMD PMF DRIVER, open list, open list:ACPI,
	Derek J . Clark, Antheas Kapenekakis, me, Denis Benato,
	Mario Limonciello, Yijun Shen



On 3/6/2025 09:14, Mario Limonciello wrote:
> From: Mario Limonciello <mario.limonciello@amd.com>
> 
> amd_pmf_get_slider_info() checks the current profile to report correct
> value to the TA inputs.  If hidden options are in use then the wrong
> values will be reported to TA.
> 
> Add the two compat options PLATFORM_PROFILE_BALANCED_PERFORMANCE and
> PLATFORM_PROFILE_QUIET for this use.
> 
> Reported-by: Yijun Shen <Yijun.Shen@dell.com>
> Fixes: 9a43102daf64d ("platform/x86/amd: pmf: Add balanced-performance to hidden choices")
> Fixes: 44e94fece5170 ("platform/x86/amd: pmf: Add 'quiet' to hidden choices")
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>

Acked-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>

> ---
>  drivers/platform/x86/amd/pmf/spc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/platform/x86/amd/pmf/spc.c b/drivers/platform/x86/amd/pmf/spc.c
> index f34f3130c3307..1d90f9382024b 100644
> --- a/drivers/platform/x86/amd/pmf/spc.c
> +++ b/drivers/platform/x86/amd/pmf/spc.c
> @@ -219,12 +219,14 @@ static int amd_pmf_get_slider_info(struct amd_pmf_dev *dev, struct ta_pmf_enact_
>  
>  	switch (dev->current_profile) {
>  	case PLATFORM_PROFILE_PERFORMANCE:
> +	case PLATFORM_PROFILE_BALANCED_PERFORMANCE:
>  		val = TA_BEST_PERFORMANCE;
>  		break;
>  	case PLATFORM_PROFILE_BALANCED:
>  		val = TA_BETTER_PERFORMANCE;
>  		break;
>  	case PLATFORM_PROFILE_LOW_POWER:
> +	case PLATFORM_PROFILE_QUIET:
>  		val = TA_BEST_BATTERY;
>  		break;
>  	default:


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

* Re: [PATCH] platform/x86/amd: pmf: Fix missing hidden options for Smart PC
  2025-03-06  3:44 [PATCH] platform/x86/amd: pmf: Fix missing hidden options for Smart PC Mario Limonciello
  2025-03-06  4:11 ` Shyam Sundar S K
@ 2025-03-10 17:19 ` Ilpo Järvinen
  2025-03-12 21:27   ` Mario Limonciello
  1 sibling, 1 reply; 5+ messages in thread
From: Ilpo Järvinen @ 2025-03-10 17:19 UTC (permalink / raw)
  To: Mario Limonciello
  Cc: Shyam Sundar S K, Rafael J . Wysocki, Hans de Goede,
	Luke D . Jones, Mark Pearson, open list:AMD PMF DRIVER, open list,
	open list:ACPI, Derek J . Clark, Antheas Kapenekakis, me,
	Denis Benato, Mario Limonciello, Yijun Shen

On Wed, 5 Mar 2025, Mario Limonciello wrote:

> From: Mario Limonciello <mario.limonciello@amd.com>
> 
> amd_pmf_get_slider_info() checks the current profile to report correct
> value to the TA inputs.  If hidden options are in use then the wrong
> values will be reported to TA.
> 
> Add the two compat options PLATFORM_PROFILE_BALANCED_PERFORMANCE and
> PLATFORM_PROFILE_QUIET for this use.
> 
> Reported-by: Yijun Shen <Yijun.Shen@dell.com>
> Fixes: 9a43102daf64d ("platform/x86/amd: pmf: Add balanced-performance to hidden choices")
> Fixes: 44e94fece5170 ("platform/x86/amd: pmf: Add 'quiet' to hidden choices")
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
>  drivers/platform/x86/amd/pmf/spc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/platform/x86/amd/pmf/spc.c b/drivers/platform/x86/amd/pmf/spc.c
> index f34f3130c3307..1d90f9382024b 100644
> --- a/drivers/platform/x86/amd/pmf/spc.c
> +++ b/drivers/platform/x86/amd/pmf/spc.c
> @@ -219,12 +219,14 @@ static int amd_pmf_get_slider_info(struct amd_pmf_dev *dev, struct ta_pmf_enact_
>  
>  	switch (dev->current_profile) {
>  	case PLATFORM_PROFILE_PERFORMANCE:
> +	case PLATFORM_PROFILE_BALANCED_PERFORMANCE:
>  		val = TA_BEST_PERFORMANCE;
>  		break;
>  	case PLATFORM_PROFILE_BALANCED:
>  		val = TA_BETTER_PERFORMANCE;
>  		break;
>  	case PLATFORM_PROFILE_LOW_POWER:
> +	case PLATFORM_PROFILE_QUIET:
>  		val = TA_BEST_BATTERY;
>  		break;
>  	default:

Hi Mario,

Just for me to be sure what I'm supposed to do with all these patches 
related to this platform profile legacy handling... :-)

So this fix is necessary in addition to the 3 patches that got already 
merged through Rafaels tree?

What about this patch from Luke:

https://patchwork.kernel.org/project/platform-driver-x86/patch/20250224223551.16918-1-luke@ljones.dev/

Is that also needed?

Thanks in advance.

-- 
 i.

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

* Re: [PATCH] platform/x86/amd: pmf: Fix missing hidden options for Smart PC
  2025-03-10 17:19 ` Ilpo Järvinen
@ 2025-03-12 21:27   ` Mario Limonciello
  2025-03-13 12:57     ` Ilpo Järvinen
  0 siblings, 1 reply; 5+ messages in thread
From: Mario Limonciello @ 2025-03-12 21:27 UTC (permalink / raw)
  To: Ilpo Järvinen
  Cc: Shyam Sundar S K, Rafael J . Wysocki, Hans de Goede,
	Luke D . Jones, Mark Pearson, open list:AMD PMF DRIVER, open list,
	open list:ACPI, Derek J . Clark, Antheas Kapenekakis, me,
	Denis Benato, Mario Limonciello, Yijun Shen



On 3/10/25 12:19, Ilpo Järvinen wrote:
> On Wed, 5 Mar 2025, Mario Limonciello wrote:
> 
>> From: Mario Limonciello <mario.limonciello@amd.com>
>>
>> amd_pmf_get_slider_info() checks the current profile to report correct
>> value to the TA inputs.  If hidden options are in use then the wrong
>> values will be reported to TA.
>>
>> Add the two compat options PLATFORM_PROFILE_BALANCED_PERFORMANCE and
>> PLATFORM_PROFILE_QUIET for this use.
>>
>> Reported-by: Yijun Shen <Yijun.Shen@dell.com>
>> Fixes: 9a43102daf64d ("platform/x86/amd: pmf: Add balanced-performance to hidden choices")
>> Fixes: 44e94fece5170 ("platform/x86/amd: pmf: Add 'quiet' to hidden choices")
>> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>> ---
>>   drivers/platform/x86/amd/pmf/spc.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/platform/x86/amd/pmf/spc.c b/drivers/platform/x86/amd/pmf/spc.c
>> index f34f3130c3307..1d90f9382024b 100644
>> --- a/drivers/platform/x86/amd/pmf/spc.c
>> +++ b/drivers/platform/x86/amd/pmf/spc.c
>> @@ -219,12 +219,14 @@ static int amd_pmf_get_slider_info(struct amd_pmf_dev *dev, struct ta_pmf_enact_
>>   
>>   	switch (dev->current_profile) {
>>   	case PLATFORM_PROFILE_PERFORMANCE:
>> +	case PLATFORM_PROFILE_BALANCED_PERFORMANCE:
>>   		val = TA_BEST_PERFORMANCE;
>>   		break;
>>   	case PLATFORM_PROFILE_BALANCED:
>>   		val = TA_BETTER_PERFORMANCE;
>>   		break;
>>   	case PLATFORM_PROFILE_LOW_POWER:
>> +	case PLATFORM_PROFILE_QUIET:
>>   		val = TA_BEST_BATTERY;
>>   		break;
>>   	default:
> 
> Hi Mario,
> 
> Just for me to be sure what I'm supposed to do with all these patches
> related to this platform profile legacy handling... :-)
> 
> So this fix is necessary in addition to the 3 patches that got already
> merged through Rafaels tree?
> 
> What about this patch from Luke:
> 
> https://patchwork.kernel.org/project/platform-driver-x86/patch/20250224223551.16918-1-luke@ljones.dev/
> 
> Is that also needed?
> 
> Thanks in advance.
> 

Yes; this was another finding that Yijun discovered missing as part of 
testing Rafael's tree.  It can go through your tree or Rafael's.  It 
doesn't really matter.

Luke's patch isn't needed anymore.

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

* Re: [PATCH] platform/x86/amd: pmf: Fix missing hidden options for Smart PC
  2025-03-12 21:27   ` Mario Limonciello
@ 2025-03-13 12:57     ` Ilpo Järvinen
  0 siblings, 0 replies; 5+ messages in thread
From: Ilpo Järvinen @ 2025-03-13 12:57 UTC (permalink / raw)
  To: Mario Limonciello
  Cc: Shyam Sundar S K, Rafael J . Wysocki, Hans de Goede,
	Luke D . Jones, Mark Pearson, open list:AMD PMF DRIVER, open list,
	open list:ACPI, Derek J . Clark, Antheas Kapenekakis, me,
	Denis Benato, Mario Limonciello, Yijun Shen

[-- Attachment #1: Type: text/plain, Size: 2575 bytes --]

On Wed, 12 Mar 2025, Mario Limonciello wrote:

> 
> 
> On 3/10/25 12:19, Ilpo Järvinen wrote:
> > On Wed, 5 Mar 2025, Mario Limonciello wrote:
> > 
> > > From: Mario Limonciello <mario.limonciello@amd.com>
> > > 
> > > amd_pmf_get_slider_info() checks the current profile to report correct
> > > value to the TA inputs.  If hidden options are in use then the wrong
> > > values will be reported to TA.
> > > 
> > > Add the two compat options PLATFORM_PROFILE_BALANCED_PERFORMANCE and
> > > PLATFORM_PROFILE_QUIET for this use.
> > > 
> > > Reported-by: Yijun Shen <Yijun.Shen@dell.com>
> > > Fixes: 9a43102daf64d ("platform/x86/amd: pmf: Add balanced-performance to
> > > hidden choices")
> > > Fixes: 44e94fece5170 ("platform/x86/amd: pmf: Add 'quiet' to hidden
> > > choices")
> > > Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> > > ---
> > >   drivers/platform/x86/amd/pmf/spc.c | 2 ++
> > >   1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/drivers/platform/x86/amd/pmf/spc.c
> > > b/drivers/platform/x86/amd/pmf/spc.c
> > > index f34f3130c3307..1d90f9382024b 100644
> > > --- a/drivers/platform/x86/amd/pmf/spc.c
> > > +++ b/drivers/platform/x86/amd/pmf/spc.c
> > > @@ -219,12 +219,14 @@ static int amd_pmf_get_slider_info(struct
> > > amd_pmf_dev *dev, struct ta_pmf_enact_
> > >     	switch (dev->current_profile) {
> > >   	case PLATFORM_PROFILE_PERFORMANCE:
> > > +	case PLATFORM_PROFILE_BALANCED_PERFORMANCE:
> > >   		val = TA_BEST_PERFORMANCE;
> > >   		break;
> > >   	case PLATFORM_PROFILE_BALANCED:
> > >   		val = TA_BETTER_PERFORMANCE;
> > >   		break;
> > >   	case PLATFORM_PROFILE_LOW_POWER:
> > > +	case PLATFORM_PROFILE_QUIET:
> > >   		val = TA_BEST_BATTERY;
> > >   		break;
> > >   	default:
> > 
> > Hi Mario,
> > 
> > Just for me to be sure what I'm supposed to do with all these patches
> > related to this platform profile legacy handling... :-)
> > 
> > So this fix is necessary in addition to the 3 patches that got already
> > merged through Rafaels tree?
> > 
> > What about this patch from Luke:
> > 
> > https://patchwork.kernel.org/project/platform-driver-x86/patch/20250224223551.16918-1-luke@ljones.dev/
> > 
> > Is that also needed?
> > 
> > Thanks in advance.
> > 
> 
> Yes; this was another finding that Yijun discovered missing as part of testing
> Rafael's tree.  It can go through your tree or Rafael's.  It doesn't really
> matter.

I took this into fixes branch.

> Luke's patch isn't needed anymore.

Okay, thanks.

-- 
 i.

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

end of thread, other threads:[~2025-03-13 12:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-06  3:44 [PATCH] platform/x86/amd: pmf: Fix missing hidden options for Smart PC Mario Limonciello
2025-03-06  4:11 ` Shyam Sundar S K
2025-03-10 17:19 ` Ilpo Järvinen
2025-03-12 21:27   ` Mario Limonciello
2025-03-13 12:57     ` Ilpo Järvinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox