Skip to contentSkip to conversation

platform/x86/amd: pmf: Fix missing hidden options for Smart PC

PATCH In review Mario Limonciello 3 participants 5 messages Mar 6, 2025 – Mar 13, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86/amd: pmf: Fix missing hidden options for Smart PC

From: Mario Limonciello <[email protected]>

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.

Fixes 9a43102daf64d ("platform/x86/amd: pmf: Add balanced-performance to hidden choices")
Fixes 44e94fece5170 ("platform/x86/amd: pmf: Add 'quiet' to hidden choices")
---
 drivers/platform/x86/amd/pmf/spc.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/platform/x86/amd/pmf/spc.c +2 -0
index f34f3130c3307..1d90f9382024b 100644
@@ -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:
Signature · 1 line
2.43.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Mario Limonciello

From: Mario Limonciello <[email protected]>

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.

Quoted 7 lines

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

Fixes 9a43102daf64d ("platform/x86/amd: pmf: Add balanced-performance to hidden choices")
Fixes 44e94fece5170 ("platform/x86/amd: pmf: Add 'quiet' to hidden choices")
Quoted 23 lines
---
 drivers/platform/x86/amd/pmf/spc.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/platform/x86/amd/pmf/spc.c +2 -0
index f34f3130c3307..1d90f9382024b 100644
@@ -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:
maintainer
#2 lore raw
In reply to Mario Limonciello
Quoted 26 lines · Mario Limonciello

From: Mario Limonciello <[email protected]>

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.

Fixes 9a43102daf64d ("platform/x86/amd: pmf: Add balanced-performance to hidden choices")
Fixes 44e94fece5170 ("platform/x86/amd: pmf: Add 'quiet' to hidden choices")
---
 drivers/platform/x86/amd/pmf/spc.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/platform/x86/amd/pmf/spc.c +1 -0
index f34f3130c3307..1d90f9382024b 100644
@@ -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:

drivers/platform/x86/amd/pmf/spc.c static int amd_pmf_get_slider_info(struct amd_pmf_dev *dev, struct ta_pmf_enact_ · line 232

Quoted 10 lines
drivers/platform/x86/amd/pmf/spc.c +1 -0
 		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/[email protected]/

Is that also needed?

Thanks in advance.

Signature · 1 line
 i.
#3 lore raw
Quoted 47 lines · Ilpo Järvinen
Quoted 26 lines · Mario Limonciello

From: Mario Limonciello <[email protected]>

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.

Fixes 9a43102daf64d ("platform/x86/amd: pmf: Add balanced-performance to hidden choices")
Fixes 44e94fece5170 ("platform/x86/amd: pmf: Add 'quiet' to hidden choices")
---
  drivers/platform/x86/amd/pmf/spc.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/platform/x86/amd/pmf/spc.c +1 -0
index f34f3130c3307..1d90f9382024b 100644
@@ -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:

drivers/platform/x86/amd/pmf/spc.c static int amd_pmf_get_slider_info(struct amd_pmf_dev *dev, struct ta_pmf_enact_ · line 232

Quoted 10 lines
drivers/platform/x86/amd/pmf/spc.c +1 -0
  		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?

Quoted 8 lines

What about this patch from Luke:

https://patchwork.kernel.org/project/platform-driver-x86/patch/[email protected]/

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.

maintainer
#4 lore raw
Quoted 57 lines · Mario Limonciello
Quoted 54 lines · Ilpo Järvinen
Quoted 29 lines · Mario Limonciello

From: Mario Limonciello <[email protected]>

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.

Fixes 9a43102daf64d ("platform/x86/amd: pmf: Add balanced-performance to

hidden choices")

Fixes 44e94fece5170 ("platform/x86/amd: pmf: Add 'quiet' to hidden

choices")

---
  drivers/platform/x86/amd/pmf/spc.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/platform/x86/amd/pmf/spc.c +0 -0
index f34f3130c3307..1d90f9382024b 100644
@@ -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:

drivers/platform/x86/amd/pmf/spc.c +1 -0
+	case PLATFORM_PROFILE_BALANCED_PERFORMANCE:

drivers/platform/x86/amd/pmf/spc.c static int amd_pmf_get_slider_info(struct amd_pmf_dev *dev, struct ta_pmf_enact_ · line 232

Quoted 10 lines
drivers/platform/x86/amd/pmf/spc.c +1 -0
  		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/[email protected]/

Quoted 8 lines
Quoted 4 lines

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.

Quoted 1 line

Luke's patch isn't needed anymore.

Okay, thanks.

Signature · 1 line
 i.