summaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2020-12-01 13:30:19 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-01-08 17:14:55 +0100
commit0fab972eef49ef8d30eb91d6bd98861122d083d1 (patch)
treea2a658f95796ac2f1cd8d672aacb132d823197aa /drivers/base
parente590474768f1cc04852190b61dec692411b22e2a (diff)
downloadlinux-stable-0fab972eef49ef8d30eb91d6bd98861122d083d1.tar.gz
linux-stable-0fab972eef49ef8d30eb91d6bd98861122d083d1.tar.bz2
linux-stable-0fab972eef49ef8d30eb91d6bd98861122d083d1.zip
drivers: core: Detach device from power domain on shutdown
When the system is powered off or rebooted, devices are not detached from their PM domain. This results in ACPI PM not being invoked and hence PowerResouce _OFF method not being invoked for any of the devices. Because the ACPI power resources are not turned off in case of poweroff and reboot, it violates the power sequencing requirements which impacts the reliability of the devices over the lifetime of the platform. This is currently observed on all Chromebooks using ACPI. In order to solve the above problem, this change detaches a device from its PM domain whenever it is shutdown. This action is basically analogous to ->remove() from driver model perspective. Detaching the device from its PM domain ensures that the ACPI PM gets a chance to turn off the power resources for the device thus complying with its power sequencing requirements. Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Furquan Shaikh <furquan@google.com> Link: https://lore.kernel.org/r/20201201213019.1558738-1-furquan@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index e61e62b624ce..1ed95948ecec 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -23,6 +23,7 @@
#include <linux/of_device.h>
#include <linux/genhd.h>
#include <linux/mutex.h>
+#include <linux/pm_domain.h>
#include <linux/pm_runtime.h>
#include <linux/netdevice.h>
#include <linux/sched/signal.h>
@@ -4287,6 +4288,8 @@ void device_shutdown(void)
dev->driver->shutdown(dev);
}
+ dev_pm_domain_detach(dev, true);
+
device_unlock(dev);
if (parent)
device_unlock(parent);