summaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2018-01-09 10:03:40 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2018-01-10 13:13:57 +0100
commit0a99d767a9b0aae6e0fd983c889c793e4c91684c (patch)
treef54c730e76a22357aeca367e199b215c4ce91083 /drivers/base
parentc23bd3877bc21d830fa650570fc1a88bea82ecd2 (diff)
PM / core: Propagate wakeup_path status flag in __device_suspend_late()
Currently the wakeup_path status flag becomes propagated from a child device to its parent device at __device_suspend(). This allows a driver dealing with a parent device to act on the flag from its ->suspend() callback. However, in situations when the wakeup_path status flag needs to be set from a ->suspend_late() callback, its value doesn't get propagated to the parent by the PM core. Let's address this limitation, by also propagating the flag at __device_suspend_late(). Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/main.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 720e36ec84ac..02a497e7c785 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -1447,6 +1447,21 @@ int dpm_suspend_noirq(pm_message_t state)
return ret;
}
+static void dpm_propagate_wakeup_to_parent(struct device *dev)
+{
+ struct device *parent = dev->parent;
+
+ if (!parent)
+ return;
+
+ spin_lock_irq(&parent->power.lock);
+
+ if (dev->power.wakeup_path && !parent->power.ignore_children)
+ parent->power.wakeup_path = true;
+
+ spin_unlock_irq(&parent->power.lock);
+}
+
static pm_callback_t dpm_subsys_suspend_late_cb(struct device *dev,
pm_message_t state,
const char **info_p)
@@ -1527,6 +1542,7 @@ Run:
async_error = error;
goto Complete;
}
+ dpm_propagate_wakeup_to_parent(dev);
Skip:
dev->power.is_late_suspended = true;
@@ -1660,21 +1676,6 @@ static int legacy_suspend(struct device *dev, pm_message_t state,
return error;
}
-static void dpm_propagate_wakeup_to_parent(struct device *dev)
-{
- struct device *parent = dev->parent;
-
- if (!parent)
- return;
-
- spin_lock_irq(&parent->power.lock);
-
- if (dev->power.wakeup_path && !parent->power.ignore_children)
- parent->power.wakeup_path = true;
-
- spin_unlock_irq(&parent->power.lock);
-}
-
static void dpm_clear_superiors_direct_complete(struct device *dev)
{
struct device_link *link;