Skip to content

Commit

Permalink
Merge tag 'pm-4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/…
Browse files Browse the repository at this point in the history
…git/rafael/linux-pm

Pull power management fix from Rafael Wysocki:
 "This fixes a code ordering issue in the main suspend-to-idle loop that
  causes some "low power S0 idle" conditions to be incorrectly reported
  as unmet with suspend/resume debug messages enabled"

* tag 'pm-4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  PM / s2idle: Invoke the ->wake() platform callback earlier
  • Loading branch information
torvalds committed Oct 5, 2017
2 parents 076264a + ca935f8 commit 7a92616
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions kernel/power/suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 7a92616

Please sign in to comment.