Skip to contentSkip to conversation

PM: add kernel parameter to disable asynchronous suspend/resume

PATCH Superseded Tudor Ambarus 2 participants 4 messages Jul 8, 2025

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 PM: add kernel parameter to disable asynchronous suspend/resume

On some platforms, device dependencies are not properly represented by device links, which can cause issues when asynchronous power management is enabled. While it is possible to disable this via sysfs, doing so at runtime can race with the first system suspend event.

This patch introduces a kernel command-line parameter, "pm_async", which can be set to "off" to globally disable asynchronous suspend and resume operations from early boot. It effectively provides a way to set the initial value of the existing pm_async sysfs knob at boot time. This offers a robust method to fall back to synchronous (sequential) operation, which can stabilize platforms with problematic dependencies and also serve as a useful debugging tool.

The default behavior remains unchanged (asynchronous enabled). To disable it, boot the kernel with the "pm_async=off" parameter.

---
Dealing with the pixel6 downstream drivers to cope with the changes from
https://lore.kernel.org/linux-pm/[email protected]/.

Similar to what people already reported it seems pixel6 lacks proper
device links dependencies downstream causing i2c and spi client drivers
to fail to suspend. Add kernel param to disable async suspend/resume.
---
Changes in v2:
- update the documentation and the commit message to describe that the "pm_async" kernel parameter provides a way to change the initial value
of the existing /sys/power/pm_async sysfs knob.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
 Documentation/admin-guide/kernel-parameters.txt | 11 +++++++++++
 kernel/power/main.c                             |  9 +++++++++
 2 files changed, 20 insertions(+)
Documentation/admin-guide/kernel-parameters.txt +11 -0
index f1f2c0874da9ddfc95058c464fdf5dabaf0de713..33ca6b881b1d77bdeea765b19291a90b2a82e8a3 100644
@@ -5000,6 +5000,17 @@
 			that number, otherwise (e.g., 'pmu_override=on'), MMCR1
 			remains 0.
 
+	pm_async	[PM]
+			If set to "off", disables asynchronous suspend and
+			resume of devices during system-wide power transitions.
+			This parameter sets the initial value of the
+			/sys/power/pm_async sysfs knob at boot time.
+			This can be useful on platforms where device
+			dependencies are not well-defined, or for debugging
+			power management issues. Defaults to "on" (asynchronous
+			operations enabled).
+
+
 	pm_debug_messages	[SUSPEND,KNL]
 			Enable suspend/resume debug messages during boot up.
 
kernel/power/main.c +9 -0
index 3d484630505ae91fea29f7f9b3fbcf7e585955d8..3cf2d7e72567ecbea2cd80acd3c7f6da85f5bef4 100644
@@ -8,6 +8,7 @@
 
 #include <linux/acpi.h>
 #include <linux/export.h>
+#include <linux/init.h>
 #include <linux/kobject.h>
 #include <linux/string.h>
 #include <linux/pm-trace.h>
@@ -112,6 +113,14 @@ int pm_notifier_call_chain(unsigned long val)
 /* If set, devices may be suspended and resumed asynchronously. */
 int pm_async_enabled = 1;
 
+static int __init pm_async_setup(char *str)
+{
+	if (!strcmp(str, "off"))
+		pm_async_enabled = 0;
+	return 1;
+}
+__setup("pm_async=", pm_async_setup);
+
 static ssize_t pm_async_show(struct kobject *kobj, struct kobj_attribute *attr,
 			     char *buf)
 {

---
base-commit: d7b8f8e20813f0179d8ef519541a3527e7661d3a
change-id: 20250708-pm-async-off-bf2a3e2a27ef

Best regards,

Signature · 1 line
Tudor Ambarus <[email protected]>
reviewer
#1 lore raw

Hi,

Documentation/admin-guide/kernel-parameters.txt line 5002

Quoted 13 lines · Tudor Ambarus
---
 Documentation/admin-guide/kernel-parameters.txt | 11 +++++++++++
 kernel/power/main.c                             |  9 +++++++++
 2 files changed, 20 insertions(+)
Documentation/admin-guide/kernel-parameters.txt +0 -0
index f1f2c0874da9ddfc95058c464fdf5dabaf0de713..33ca6b881b1d77bdeea765b19291a90b2a82e8a3 100644
@@ -5000,6 +5000,17 @@
 			that number, otherwise (e.g., 'pmu_override=on'), MMCR1
 			remains 0.
 

This should be more like:

	pm_async=off	[PM]

or

Documentation/admin-guide/kernel-parameters.txt line 5003

Quoted 1 line
Documentation/admin-guide/kernel-parameters.txt +1 -0
+	pm_async	[PM]
	pm_async=	[PM]
			Format: off
Quoted 12 lines
Documentation/admin-guide/kernel-parameters.txt +10 -0
+			If set to "off", disables asynchronous suspend and
+			resume of devices during system-wide power transitions.
+			This parameter sets the initial value of the
+			/sys/power/pm_async sysfs knob at boot time.
+			This can be useful on platforms where device
+			dependencies are not well-defined, or for debugging
+			power management issues. Defaults to "on" (asynchronous
+			operations enabled).
+
+
 	pm_debug_messages	[SUSPEND,KNL]
 			Enable suspend/resume debug messages during boot up.
Signature · 1 line
~Randy
#2 lore raw
Quoted 2 lines · Randy Dunlap

Hi,

Hi, Randy!

Quoted 19 lines · Tudor Ambarus
Quoted 11 lines
---
 Documentation/admin-guide/kernel-parameters.txt | 11 +++++++++++
 kernel/power/main.c                             |  9 +++++++++
 2 files changed, 20 insertions(+)
Documentation/admin-guide/kernel-parameters.txt +0 -0
index f1f2c0874da9ddfc95058c464fdf5dabaf0de713..33ca6b881b1d77bdeea765b19291a90b2a82e8a3 100644

Documentation/admin-guide/kernel-parameters.txt line 5002

Quoted 3 lines
Documentation/admin-guide/kernel-parameters.txt +0 -0
@@ -5000,6 +5000,17 @@
 			that number, otherwise (e.g., 'pmu_override=on'), MMCR1
 			remains 0.
 

This should be more like:

Quoted 8 lines
	pm_async=off	[PM]

or

Documentation/admin-guide/kernel-parameters.txt line 5003

Quoted 1 line
Documentation/admin-guide/kernel-parameters.txt +1 -0
+	pm_async	[PM]
	pm_async=	[PM]
			Format: off

Indeed. I see this second description, "kernel_param=", largely used in the existing kernel parameters, so maybe that's what I shall follow. However, I don't really know which format to choose, I see:

Format: <string>
Format: { off }
Format: {off}
Format: { "off" }
Format: {"off"}
Format: off

Any idea if there's an already agreed string format? Thanks,
ta

reviewer
#3 lore raw
Quoted 40 lines · Tudor Ambarus
Quoted 2 lines · Randy Dunlap

Hi,

Hi, Randy!

Quoted 19 lines · Tudor Ambarus
Quoted 11 lines
---
 Documentation/admin-guide/kernel-parameters.txt | 11 +++++++++++
 kernel/power/main.c                             |  9 +++++++++
 2 files changed, 20 insertions(+)
Documentation/admin-guide/kernel-parameters.txt +0 -0
index f1f2c0874da9ddfc95058c464fdf5dabaf0de713..33ca6b881b1d77bdeea765b19291a90b2a82e8a3 100644

Documentation/admin-guide/kernel-parameters.txt line 5002

Quoted 3 lines
Documentation/admin-guide/kernel-parameters.txt +0 -0
@@ -5000,6 +5000,17 @@
 			that number, otherwise (e.g., 'pmu_override=on'), MMCR1
 			remains 0.
 

This should be more like:

Quoted 8 lines
	pm_async=off	[PM]

or

Documentation/admin-guide/kernel-parameters.txt line 5003

Quoted 1 line
Documentation/admin-guide/kernel-parameters.txt +1 -0
+	pm_async	[PM]
	pm_async=	[PM]
			Format: off

Indeed. I see this second description, "kernel_param=", largely used in the existing kernel parameters, so maybe that's what I shall follow. However, I don't really know which format to choose, I see:

Quoted 8 lines

Format: <string>
Format: { off }
Format: {off}
Format: { "off" }
Format: {"off"}
Format: off

Any idea if there's an already agreed string format?

Hi,
AFAIK there isn't one. Just choose one. :)

I would go with the first choice that I listed
but it's up to you.

Signature · 1 line
~Randy