aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/core.c
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2011-11-15 15:52:29 -0500
committerRafael J. Wysocki <rjw@sisk.pl>2011-11-15 15:52:29 -0500
commitaf8db1508f2c9f3b6e633e2d2d906c6557c617f9 (patch)
tree5df2fc9b5d3fad990c6eaf187ebbe5ba7ecdb872 /drivers/base/core.c
parent6c81f90588972b8631bda4d538ffd0199a3e1b41 (diff)
PM / driver core: disable device's runtime PM during shutdown
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> Cc: stable@kernel.org Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
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 82c865452c70..d8b3d89db043 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -22,6 +22,7 @@
22#include <linux/kallsyms.h> 22#include <linux/kallsyms.h>
23#include <linux/mutex.h> 23#include <linux/mutex.h>
24#include <linux/async.h> 24#include <linux/async.h>
25#include <linux/pm_runtime.h>
25 26
26#include "base.h" 27#include "base.h"
27#include "power/power.h" 28#include "power/power.h"
@@ -1742,6 +1743,8 @@ void device_shutdown(void)
1742 */ 1743 */
1743 list_del_init(&dev->kobj.entry); 1744 list_del_init(&dev->kobj.entry);
1744 spin_unlock(&devices_kset->list_lock); 1745 spin_unlock(&devices_kset->list_lock);
1746 /* Disable all device's runtime power management */
1747 pm_runtime_disable(dev);
1745 1748
1746 if (dev->bus && dev->bus->shutdown) { 1749 if (dev->bus && dev->bus->shutdown) {
1747 dev_dbg(dev, "shutdown\n"); 1750 dev_dbg(dev, "shutdown\n");