public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] driver core: disable device's runtime pm during shutdown
@ 2011-11-14  0:43 Peter Chen
  2011-11-14  9:54 ` Ming Lei
  2011-11-14 22:27 ` Rafael J. Wysocki
  0 siblings, 2 replies; 30+ messages in thread
From: Peter Chen @ 2011-11-14  0:43 UTC (permalink / raw)
  To: gregkh, linux-kernel; +Cc: linux-pm, rjw, stern, hzpeterchen

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>
---
 drivers/base/core.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index bc8729d..78445f4 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");
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2011-12-06 22:02 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-14  0:43 [PATCH 1/1] driver core: disable device's runtime pm during shutdown Peter Chen
2011-11-14  9:54 ` Ming Lei
2011-11-14 22:28   ` Rafael J. Wysocki
2011-11-14 22:27 ` Rafael J. Wysocki
2011-11-15  0:59   ` Greg KH
2011-11-15 23:16     ` Rafael J. Wysocki
2011-12-04 21:56       ` NeilBrown
2011-12-05  2:42         ` Alan Stern
2011-12-05  3:37           ` NeilBrown
2011-12-05  3:26         ` Ming Lei
2011-12-05  4:42           ` Chen Peter-B29397
2011-12-05  5:12             ` Ming Lei
2011-12-05  9:01               ` Ming Lei
2011-12-05  9:05                 ` Ming Lei
2011-12-05 16:02                   ` Alan Stern
2011-12-05 18:35                     ` NeilBrown
2011-12-05 20:55                       ` Alan Stern
2011-12-05 22:32                         ` Rafael J. Wysocki
2011-12-06 15:26                           ` [PATCH] Driver core: leave runtime PM enabled during system shutdown Alan Stern
2011-12-06 21:34                             ` NeilBrown
2011-12-06 21:48                             ` Greg KH
2011-12-06 22:05                               ` Rafael J. Wysocki
2011-12-06 22:03                             ` Rafael J. Wysocki
2011-12-05  4:53           ` [PATCH 1/1] driver core: disable device's runtime pm during shutdown NeilBrown
2011-12-05  5:53             ` Chen Peter-B29397
2011-12-05  8:08               ` NeilBrown
2011-12-05  8:32                 ` Chen Peter-B29397
2011-12-05  8:52                   ` NeilBrown
2011-12-05  3:29         ` Chen Peter-B29397
2011-12-05  5:09           ` NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox