Skip to contentSkip to conversation

platform/x86/amd/pmf: Introduce option to disable Smart PC function in PMF

PATCH In review Alexey Zagorodnikov 3 participants 6 messages Jan 17 – Jan 19

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

cover platform/x86/amd/pmf: Introduce option to disable Smart PC function in PMF

This patch introduces an option to disable Smart PC function in amd_pmf driver.
Sometimes, the vendor firmware may contain bugs or other unwanted behaviours in the power management domain. This option allows the user to manually disable Smart PC power management and fall back to another strategy.

Alexey Zagorodnikov (1):
platform/x86/amd/pmf: Introduce option to disable Smart PC function in
PMF

 drivers/platform/x86/amd/pmf/core.c | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)
Signature · 1 line
2.52.0
#1 lore raw

PATCH 1/1 platform/x86/amd/pmf: Introduce option to disable Smart PC function in PMF

---
 drivers/platform/x86/amd/pmf/core.c | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)
drivers/platform/x86/amd/pmf/core.c +14 -5
index 8fc293c9c5380..00a4fc899c727 100644
@@ -53,6 +53,11 @@ static bool force_load;
 module_param(force_load, bool, 0444);
 MODULE_PARM_DESC(force_load, "Force load this driver on supported older platforms (experimental)");
 
+/* Force to disable Smart PC Solution */
+static bool disable_smart_pc;
+module_param(disable_smart_pc, bool, 0444);
+MODULE_PARM_DESC(disable_smart_pc, "Disable Smart PC Solution");
+
 static int amd_pmf_pwr_src_notify_call(struct notifier_block *nb, unsigned long event, void *data)
 {
 	struct amd_pmf_dev *pmf = container_of(nb, struct amd_pmf_dev, pwr_src_notifier);
@@ -362,11 +367,15 @@ static void amd_pmf_init_features(struct amd_pmf_dev *dev)
 		dev_dbg(dev->dev, "SPS enabled and Platform Profiles registered\n");
 	}
 
-	amd_pmf_init_smart_pc(dev);
-	if (dev->smart_pc_enabled) {
-		dev_dbg(dev->dev, "Smart PC Solution Enabled\n");
-		/* If Smart PC is enabled, no need to check for other features */
-		return;
+	if (disable_smart_pc) {
+		dev->smart_pc_enabled = false;
+	} else {
+		amd_pmf_init_smart_pc(dev);
+		if (dev->smart_pc_enabled) {
+			dev_dbg(dev->dev, "Smart PC Solution Enabled\n");
+			/* If Smart PC is enabled, no need to check for other features */
+			return;
+		}
 	}
 
 	if (is_apmf_func_supported(dev, APMF_FUNC_AUTO_MODE)) {
Signature · 1 line
2.52.0
maintainer
#2 lore raw
Quoted 1 line · Alexey Zagorodnikov

Please include the context in the commit message instead of the cover letter. Additionally, if there are any bug reports or issue tracker entries (e.g., Bugzilla) documenting the problem this addresses, please reference them to provide justification for the change.

Thanks,
Shyam

Quoted 41 lines
---
 drivers/platform/x86/amd/pmf/core.c | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)
drivers/platform/x86/amd/pmf/core.c +14 -5
index 8fc293c9c5380..00a4fc899c727 100644
@@ -53,6 +53,11 @@ static bool force_load;
 module_param(force_load, bool, 0444);
 MODULE_PARM_DESC(force_load, "Force load this driver on supported older platforms (experimental)");
 
+/* Force to disable Smart PC Solution */
+static bool disable_smart_pc;
+module_param(disable_smart_pc, bool, 0444);
+MODULE_PARM_DESC(disable_smart_pc, "Disable Smart PC Solution");
+
 static int amd_pmf_pwr_src_notify_call(struct notifier_block *nb, unsigned long event, void *data)
 {
 	struct amd_pmf_dev *pmf = container_of(nb, struct amd_pmf_dev, pwr_src_notifier);
@@ -362,11 +367,15 @@ static void amd_pmf_init_features(struct amd_pmf_dev *dev)
 		dev_dbg(dev->dev, "SPS enabled and Platform Profiles registered\n");
 	}
 
-	amd_pmf_init_smart_pc(dev);
-	if (dev->smart_pc_enabled) {
-		dev_dbg(dev->dev, "Smart PC Solution Enabled\n");
-		/* If Smart PC is enabled, no need to check for other features */
-		return;
+	if (disable_smart_pc) {
+		dev->smart_pc_enabled = false;
+	} else {
+		amd_pmf_init_smart_pc(dev);
+		if (dev->smart_pc_enabled) {
+			dev_dbg(dev->dev, "Smart PC Solution Enabled\n");
+			/* If Smart PC is enabled, no need to check for other features */
+			return;
+		}
 	}
 
 	if (is_apmf_func_supported(dev, APMF_FUNC_AUTO_MODE)) {
#3 lore raw

Sorry for the inconvenience, it is my first time :)

Originally bugreport here https://gitlab.freedesktop.org/drm/amd/-/issues/4868

But it turned out to be not a real bug, but rather a feature of the firmware, which in my case is not desirable. Would nice to have a toggle to disable, instead of completely blacklist module.

Should I send v2 patch with a new message?

Quoted 53 lines · Shyam Sundar S K
Quoted 1 line · Alexey Zagorodnikov

Please include the context in the commit message instead of the cover letter. Additionally, if there are any bug reports or issue tracker entries (e.g., Bugzilla) documenting the problem this addresses, please reference them to provide justification for the change.

Thanks,
Shyam

Quoted 41 lines
---
  drivers/platform/x86/amd/pmf/core.c | 19 ++++++++++++++-----
  1 file changed, 14 insertions(+), 5 deletions(-)
drivers/platform/x86/amd/pmf/core.c +14 -5
index 8fc293c9c5380..00a4fc899c727 100644
@@ -53,6 +53,11 @@ static bool force_load;
  module_param(force_load, bool, 0444);
  MODULE_PARM_DESC(force_load, "Force load this driver on supported older platforms (experimental)");
 
+/* Force to disable Smart PC Solution */
+static bool disable_smart_pc;
+module_param(disable_smart_pc, bool, 0444);
+MODULE_PARM_DESC(disable_smart_pc, "Disable Smart PC Solution");
+
  static int amd_pmf_pwr_src_notify_call(struct notifier_block *nb, unsigned long event, void *data)
  {
  	struct amd_pmf_dev *pmf = container_of(nb, struct amd_pmf_dev, pwr_src_notifier);
@@ -362,11 +367,15 @@ static void amd_pmf_init_features(struct amd_pmf_dev *dev)
  		dev_dbg(dev->dev, "SPS enabled and Platform Profiles registered\n");
  	}
 
-	amd_pmf_init_smart_pc(dev);
-	if (dev->smart_pc_enabled) {
-		dev_dbg(dev->dev, "Smart PC Solution Enabled\n");
-		/* If Smart PC is enabled, no need to check for other features */
-		return;
+	if (disable_smart_pc) {
+		dev->smart_pc_enabled = false;
+	} else {
+		amd_pmf_init_smart_pc(dev);
+		if (dev->smart_pc_enabled) {
+			dev_dbg(dev->dev, "Smart PC Solution Enabled\n");
+			/* If Smart PC is enabled, no need to check for other features */
+			return;
+		}
  	}
 
  	if (is_apmf_func_supported(dev, APMF_FUNC_AUTO_MODE)) {
maintainer
#4 lore raw
Quoted 3 lines · Alexey Zagorodnikov

Sorry for the inconvenience, it is my first time :)

Originally bugreport here https://gitlab.freedesktop.org/drm/amd/-/issues/4868

When the issue is reported in some tracker, the usual custom is to add a Link tag to the changelog so it will be recorded with the change into the kernel history.

Signature · 1 line
 i.
Quoted 66 lines

But it turned out to be not a real bug, but rather a feature of the firmware, which in my case is not desirable. Would nice to have a toggle to disable, instead of completely blacklist module.

Should I send v2 patch with a new message?

Quoted 58 lines · Shyam Sundar S K
Quoted 1 line · Alexey Zagorodnikov

Please include the context in the commit message instead of the cover letter. Additionally, if there are any bug reports or issue tracker entries (e.g., Bugzilla) documenting the problem this addresses, please reference them to provide justification for the change.

Thanks,
Shyam

Quoted 46 lines
---
  drivers/platform/x86/amd/pmf/core.c | 19 ++++++++++++++-----
  1 file changed, 14 insertions(+), 5 deletions(-)
drivers/platform/x86/amd/pmf/core.c +4 -0
index 8fc293c9c5380..00a4fc899c727 100644
@@ -53,6 +53,11 @@ static bool force_load;
  module_param(force_load, bool, 0444);
  MODULE_PARM_DESC(force_load, "Force load this driver on supported older
 platforms (experimental)");
  +/* Force to disable Smart PC Solution */
+static bool disable_smart_pc;
+module_param(disable_smart_pc, bool, 0444);
+MODULE_PARM_DESC(disable_smart_pc, "Disable Smart PC Solution");
+
  static int amd_pmf_pwr_src_notify_call(struct notifier_block *nb,
 unsigned long event, void *data)
  {
  	struct amd_pmf_dev *pmf = container_of(nb, struct amd_pmf_dev,

pwr_src_notifier);

drivers/platform/x86/amd/pmf/core.c +7 -4
@@ -362,11 +367,15 @@ static void amd_pmf_init_features(struct amd_pmf_dev
 *dev)
  		dev_dbg(dev->dev, "SPS enabled and Platform Profiles
 registered\n");
  	}
  -	amd_pmf_init_smart_pc(dev);
-	if (dev->smart_pc_enabled) {
-		dev_dbg(dev->dev, "Smart PC Solution Enabled\n");
-		/* If Smart PC is enabled, no need to check for other features
 */
-		return;
+	if (disable_smart_pc) {
+		dev->smart_pc_enabled = false;
+	} else {
+		amd_pmf_init_smart_pc(dev);
+		if (dev->smart_pc_enabled) {
+			dev_dbg(dev->dev, "Smart PC Solution Enabled\n");
+			/* If Smart PC is enabled, no need to check for other

features */

drivers/platform/x86/amd/pmf/core.c +2 -0
+			return;
+		}
  	}
    	if (is_apmf_func_supported(dev, APMF_FUNC_AUTO_MODE)) {
maintainer
#5 lore raw
In reply to Alexey Zagorodnikov

On Sun, 18 Jan 2026, Alexey Zagorodnikov wrote:

No need to repeat "in PMF" in the shortlog (in the Subject) because you already have the pmf prefix).

Quoted 1 line

This patch introduces an option to disable Smart PC function in amd_pmf driver.

This description should be mostly in the patch itself (with some changes, I'll explain here).

Also, please avoid phrases that start with "This patch", "This change" etc. but use imperative tone.

Quoted 2 lines

Sometimes, the vendor firmware may contain bugs or other unwanted behaviours in the power management domain.

If there are any symptoms how an user could identify this feature is the culprit, please quote/mention them in the changelog so it can be more easily found by searches.

Quoted 1 line

This option allows the user to manually disable Smart PC power

Don't use vague phrases like this but explicitly tell what "This option" option is (according to the patch, you're adding "a module parameter").

Quoted 1 line

management and fall back to another strategy.

--
i.

Quoted 8 lines

Alexey Zagorodnikov (1):
platform/x86/amd/pmf: Introduce option to disable Smart PC function in
PMF

 drivers/platform/x86/amd/pmf/core.c | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)