]> asedeno.scripts.mit.edu Git - linux.git/commit
PM / s2idle: Invoke the ->wake() platform callback earlier
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 27 Sep 2017 23:45:10 +0000 (01:45 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 28 Sep 2017 23:26:13 +0000 (01:26 +0200)
commit87cbde8d9081b91df86a21d0d743cd700e04890a
tree50b3cfc0716b421aa03f5b45739fecdf181be10f
parente19b205be43d11bff638cad4487008c48d21c103
PM / s2idle: Invoke the ->wake() platform callback earlier

The role of the ->wake() platform callback for suspend-to-idle is to
deal with possible spurious wakeups, among other things.  The ACPI
implementation of it, acpi_s2idle_wake(), additionally checks the
conditions for entering the Low Power S0 Idle state by the platform
and reports the ones that have not been met.

However, the ->wake() platform callback is invoked after calling
dpm_noirq_resume_devices(), which means that the power states of some
devices may have changed since s2idle_enter() returned, so some unmet
Low Power S0 Idle conditions may be reported incorrectly as a result
of that.

To avoid these false positives, reorder the invocations of the
dpm_noirq_resume_devices() routine and the ->wake() platform callback
in s2idle_loop().

Fixes: 726fb6b4f2a8 (ACPI / PM: Check low power idle constraints for debug only)
Tested-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
kernel/power/suspend.c