summaryrefslogtreecommitdiff
path: root/drivers/base/core.c
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2011-11-15 21:52:29 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-26 09:08:35 -0800
commita896cd19d7569c9754a75fea01f4c68e355697af (patch)
treeb1fa48c0b672a88b576386c992f8ea54aacb200b /drivers/base/core.c
parent268cd0526224188d8d36b7071e0630ae145e88bc (diff)
PM / driver core: disable device's runtime PM during shutdown
commit af8db1508f2c9f3b6e633e2d2d906c6557c617f9 upstream. There may be an issue when the user issue "reboot/shutdown" command, then the device has shut down its hardware, after that, this runtime-pm featured device's driver will probably be scheduled to do its suspend routine, and at its suspend routine, it may access hardware, but the device has already shutdown physically, then the system hang may be occurred. I ran out this issue using an auto-suspend supported USB devices, like 3G modem, keyboard. The usb runtime suspend routine may be scheduled after the usb controller has been shut down, and the usb runtime suspend routine will try to suspend its roothub(controller), it will access register, then the system hang occurs as the controller is shutdown. Signed-off-by: Peter Chen <peter.chen@freescale.com> Acked-by: Ming Lei <tom.leiming@gmail.com> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/core.c')
-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 bc8729d603a7..78445f40c430 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -22,6 +22,7 @@
#include <linux/kallsyms.h>
#include <linux/mutex.h>
#include <linux/async.h>
+#include <linux/pm_runtime.h>
#include "base.h"
#include "power/power.h"
@@ -1742,6 +1743,8 @@ 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);
if (dev->bus && dev->bus->shutdown) {
dev_dbg(dev, "shutdown\n");