aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2011-12-06 23:24:52 +0100
committerRoman Shaposhnikov <x0166637@ti.com>2012-03-02 17:46:17 +0200
commitddb88e2fd15eae52262e0eacc71d1d971bb7705f (patch)
tree21c97768f9efa850dd93fa80e6f979aad8f90f41 /drivers/base
parent0424f1a1f4c51376d72577dd3aa9d4b511fe3ecd (diff)
downloadkernel_samsung_espresso10-ddb88e2fd15eae52262e0eacc71d1d971bb7705f.zip
kernel_samsung_espresso10-ddb88e2fd15eae52262e0eacc71d1d971bb7705f.tar.gz
kernel_samsung_espresso10-ddb88e2fd15eae52262e0eacc71d1d971bb7705f.tar.bz2
PM / Driver core: leave runtime PM enabled during system shutdown
Disabling all runtime PM during system shutdown turns out not to be a good idea, because some devices may need to be woken up from a low-power state at that time. The whole point of disabling runtime PM for system shutdown was to prevent untimely runtime-suspend method calls. This patch (as1504) accomplishes the same result by incrementing the usage count for each device and waiting for ongoing runtime-PM callbacks to finish. This is what we already do during system suspend and hibernation, which makes sense since the shutdown method is pretty much a legacy analog of the pm->poweroff method. This fixes a recent regression on some OMAP systems introduced by commit af8db1508f2c9f3b6e633e2d2d906c6557c617f9 (PM / driver core: disable device's runtime PM during shutdown). Change-Id: Ic62b6374df426dabc8bd27d175a82f5effa2c2d4 Reported-and-tested-by: NeilBrown <neilb@suse.de> Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Kostyantyn Shlyakhovoy <x0155534@ti.com>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 78445f4..d13851c 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1743,8 +1743,10 @@ void device_shutdown(void)
*/
list_del_init(&dev->kobj.entry);
spin_unlock(&devices_kset->list_lock);
- /* Disable all device's runtime power management */
- pm_runtime_disable(dev);
+
+ /* Don't allow any more runtime suspends */
+ pm_runtime_get_noresume(dev);
+ pm_runtime_barrier(dev);
if (dev->bus && dev->bus->shutdown) {
dev_dbg(dev, "shutdown\n");