summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-10-02 14:16:47 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-10-02 14:16:47 +0200
commit1a3c4aecb4266b4eb5594163bb0bf38ac488668d (patch)
tree6c6e0bb614e5ad3054b9c8a9e4eecfbbf8525eb0
parent9e66317d3c92ddaab330c125dfe9d06eee268aff (diff)
parent87cbde8d9081b91df86a21d0d743cd700e04890a (diff)
downloadlinux-1a3c4aecb4266b4eb5594163bb0bf38ac488668d.tar.gz
Merge branch 'pm-sleep' into linux-next
* pm-sleep: PM / s2idle: Invoke the ->wake() platform callback earlier
-rw-r--r--kernel/power/suspend.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 3e2b4f5..ccd2d20 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -120,22 +120,26 @@ static void s2idle_loop(void)
* frozen processes + suspended devices + idle processors.
* Thus s2idle_enter() should be called right after
* all devices have been suspended.
+ *
+ * Wakeups during the noirq suspend of devices may be spurious,
+ * so prevent them from terminating the loop right away.
*/
error = dpm_noirq_suspend_devices(PMSG_SUSPEND);
if (!error)
s2idle_enter();
+ else if (error == -EBUSY && pm_wakeup_pending())
+ error = 0;
- dpm_noirq_resume_devices(PMSG_RESUME);
- if (error && (error != -EBUSY || !pm_wakeup_pending())) {
- dpm_noirq_end();
- break;
- }
-
- if (s2idle_ops && s2idle_ops->wake)
+ if (!error && s2idle_ops && s2idle_ops->wake)
s2idle_ops->wake();
+ dpm_noirq_resume_devices(PMSG_RESUME);
+
dpm_noirq_end();
+ if (error)
+ break;
+
if (s2idle_ops && s2idle_ops->sync)
s2idle_ops->sync();