[PATCH v1 8/9] ACPI: PM: Set/clear power.strict_midlayer during attach/detach
From: Rafael J. Wysocki
Date: Wed Jun 25 2025 - 15:26:18 EST
From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
The ACPI general PM domain does not expect its runtime PM callbacks,
acpi_subsys_runtime_suspend() and acpi_subsys_runtime_resume(), to
be invoked at any point during system-wide suspend and resume, so
make it express that expectation by setting power.strict_midlayer
for devices that it is attached to. Also make it clear that flag
when it detaches from those devices.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
---
This depends on
https://lore.kernel.org/linux-acpi/4665476.LvFx2qVVIh@xxxxxxxxxxxxx/
---
drivers/acpi/device_pm.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/acpi/device_pm.c
+++ b/drivers/acpi/device_pm.c
@@ -1404,6 +1404,7 @@
struct acpi_device *adev = ACPI_COMPANION(dev);
if (adev && dev->pm_domain == &acpi_general_pm_domain) {
+ dev_pm_strict_midlayer(dev, false);
dev_pm_domain_set(dev, NULL);
acpi_remove_pm_notifier(adev);
if (power_off) {
@@ -1463,6 +1464,7 @@
acpi_add_pm_notifier(adev, dev, acpi_pm_notify_work_func);
dev_pm_domain_set(dev, &acpi_general_pm_domain);
+ dev_pm_strict_midlayer(dev, true);
if (power_on) {
acpi_dev_pm_full_power(adev);
acpi_device_wakeup_disable(adev);