aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2011-12-06 17:24:52 -0500
committerRafael J. Wysocki <rjw@sisk.pl>2011-12-07 16:26:56 -0500
commitfe6b91f47080eb17d21cbf2a39311877d57f6938 (patch)
tree0c63640274b02fdb3c95546cf966896e97bb5877 /drivers/base
parentb835c0f47f725d864bf2545f10c733b754bb6d51 (diff)
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). 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>
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 d8b3d89db043..919daa7cd5b1 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1743,8 +1743,10 @@ void device_shutdown(void)
1743 */ 1743 */
1744 list_del_init(&dev->kobj.entry); 1744 list_del_init(&dev->kobj.entry);
1745 spin_unlock(&devices_kset->list_lock); 1745 spin_unlock(&devices_kset->list_lock);
1746 /* Disable all device's runtime power management */ 1746
1747 pm_runtime_disable(dev); 1747 /* Don't allow any more runtime suspends */
1748 pm_runtime_get_noresume(dev);
1749 pm_runtime_barrier(dev);
1748 1750
1749 if (dev->bus && dev->bus->shutdown) { 1751 if (dev->bus && dev->bus->shutdown) {
1750 dev_dbg(dev, "shutdown\n"); 1752 dev_dbg(dev, "shutdown\n");