summaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2010-12-16 17:11:45 +0100
committerRafael J. Wysocki <rjw@sisk.pl>2010-12-24 15:02:44 +0100
commitb64959e6158d6dcb640fc22d7f43b94ad1c91135 (patch)
tree51208ab0468472bd2e8a33ed44a5eaa69d8247ed /drivers/base
parentb8c76f6aed0ab7df73a6410f3f82de2c831bb144 (diff)
downloadlinux-b64959e6158d6dcb640fc22d7f43b94ad1c91135.tar.gz
linux-b64959e6158d6dcb640fc22d7f43b94ad1c91135.tar.bz2
linux-b64959e6158d6dcb640fc22d7f43b94ad1c91135.zip
PM: Permit registration of parentless devices during system suspend
The registration of a new parentless device during system suspend will not lead to any complications affecting the PM core (the device will be effectively seen after the subsequent resume has completed), so remove the code used for detection of such events. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/main.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index a90480baa850..11fe6ed75278 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -49,12 +49,6 @@ LIST_HEAD(dpm_noirq_list);
static DEFINE_MUTEX(dpm_list_mtx);
static pm_message_t pm_transition;
-/*
- * Set once the preparation of devices for a PM transition has started, reset
- * before starting to resume devices. Protected by dpm_list_mtx.
- */
-static bool transition_started;
-
static int async_error;
/**
@@ -97,19 +91,9 @@ void device_pm_add(struct device *dev)
dev->bus ? dev->bus->name : "No Bus",
kobject_name(&dev->kobj));
mutex_lock(&dpm_list_mtx);
- if (dev->parent) {
- if (dev->parent->power.in_suspend)
- dev_warn(dev, "parent %s should not be sleeping\n",
- dev_name(dev->parent));
- } else if (transition_started) {
- /*
- * We refuse to register parentless devices while a PM
- * transition is in progress in order to avoid leaving them
- * unhandled down the road
- */
- dev_WARN(dev, "Parentless device registered during a PM transaction\n");
- }
-
+ if (dev->parent && dev->parent->power.in_suspend)
+ dev_warn(dev, "parent %s should not be sleeping\n",
+ dev_name(dev->parent));
list_add_tail(&dev->power.entry, &dpm_list);
mutex_unlock(&dpm_list_mtx);
}
@@ -482,7 +466,6 @@ void dpm_resume_noirq(pm_message_t state)
ktime_t starttime = ktime_get();
mutex_lock(&dpm_list_mtx);
- transition_started = false;
while (!list_empty(&dpm_noirq_list)) {
struct device *dev = to_device(dpm_noirq_list.next);
int error;
@@ -684,7 +667,6 @@ static void dpm_complete(pm_message_t state)
INIT_LIST_HEAD(&list);
mutex_lock(&dpm_list_mtx);
- transition_started = false;
while (!list_empty(&dpm_prepared_list)) {
struct device *dev = to_device(dpm_prepared_list.prev);
@@ -1020,7 +1002,6 @@ static int dpm_prepare(pm_message_t state)
int error = 0;
mutex_lock(&dpm_list_mtx);
- transition_started = true;
while (!list_empty(&dpm_list)) {
struct device *dev = to_device(dpm_list.next);