summaryrefslogtreecommitdiff
path: root/kernel/power
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-10-14 00:50:31 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-10-14 00:50:31 +0200
commit69f658e399f3d9cb9c9680afb714ba23860d7ccb (patch)
tree13fbc42f466cb10d319514e4ddec53def8c554f6 /kernel/power
parent9867999f3a85b52f96ef05fca00cc8128eed01ce (diff)
parent42f6284ae602469762ee721ec31ddfc6170e00bc (diff)
Merge branch 'pm-domains' into pm-opp
Diffstat (limited to 'kernel/power')
-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 3e2b4f519009..ccd2d20e6b06 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();