]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ACPI: PM: Set/clear power.strict_midlayer in prepare/complete
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 27 Jun 2025 19:25:22 +0000 (21:25 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 3 Jul 2025 15:10:40 +0000 (17:10 +0200)
The ACPI general PM domain and the LPSS PM domain do not expect their
mid-layer runtime PM suspend callbacks to be invoked at all during
system-wide suspend and resume and they do not expect their runtime
resume callbacks to be invoked at any point when runtime PM is disabled
for the given device during system suspend and resume, so make
acpi_subsys_prepare() set power.strict_midlayer for the given device
to express that expectation and make acpi_subsys_complete() clear it.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://patch.msgid.link/4463062.ejJDZkT8p0@rjwysocki.net
drivers/acpi/device_pm.c

index dbd4446025ecdb9c2e193cf76e983b649aa5e20d..9a4d059f1d23ae8fc3eb79fcb41ffe6c0dbf7a58 100644 (file)
@@ -1119,6 +1119,8 @@ int acpi_subsys_prepare(struct device *dev)
 {
        struct acpi_device *adev = ACPI_COMPANION(dev);
 
+       dev_pm_set_strict_midlayer(dev, true);
+
        if (dev->driver && dev->driver->pm && dev->driver->pm->prepare) {
                int ret = dev->driver->pm->prepare(dev);
 
@@ -1147,6 +1149,8 @@ void acpi_subsys_complete(struct device *dev)
         */
        if (pm_runtime_suspended(dev) && pm_resume_via_firmware())
                pm_request_resume(dev);
+
+       dev_pm_set_strict_midlayer(dev, false);
 }
 EXPORT_SYMBOL_GPL(acpi_subsys_complete);