android_kernel_google_msm/kernel/power
Liu ShuoX 3da71738d2 PM / Sleep: avoid 'autosleep' in shutdown progress
commit e5248a111b upstream.

Prevent automatic system suspend from happening during system
shutdown by making try_to_suspend() check system_state and return
immediately if it is not SYSTEM_RUNNING.

This prevents the following breakage from happening (scenario from
Zhang Yanmin):

 Kernel starts shutdown and calls all device driver's shutdown
 callback.  When a driver's shutdown is called, the last wakelock is
 released and suspend-to-ram starts.  However, as some driver's shut
 down callbacks already shut down devices and disabled runtime pm,
 the suspend-to-ram calls driver's suspend callback without noticing
 that device is already off and causes crash.

Change-Id: I09261fe136713cb6bdd66e061a9e886d077324c5
[rjw: Changelog]
Signed-off-by: Liu ShuoX <shuox.liu@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 426b7d5074424aab388af948ba75a5e1c8b9a702)
2017-10-15 17:05:14 +03:00
..
autosleep.c PM / Sleep: avoid 'autosleep' in shutdown progress 2017-10-15 17:05:14 +03:00
block_io.c
console.c
consoleearlysuspend.c
earlysuspend.c PM / Sleep: Clean up remnants of workqueue-based sync 2017-10-15 15:46:58 +03:00
fbearlysuspend.c
hibernate.c
Kconfig PM: wakeup_reasons: disable wakeup-reason deduction by default 2017-10-15 17:05:11 +03:00
main.c PM / Sleep: Fix a mistake in a conditional in autosleep_store() 2017-10-15 15:46:58 +03:00
Makefile power: add partial-resume framework 2017-10-15 17:05:08 +03:00
partialresume.c power: add partial-resume framework 2017-10-15 17:05:08 +03:00
power.h PM / Sleep: Add user space interface for manipulating wakeup sources, v3 2017-10-15 15:46:55 +03:00
poweroff.c
process.c power: Avoids bogus error messages for the suspend aborts. 2017-10-15 17:05:10 +03:00
qos.c
snapshot.c
suspend.c PM: Check dpm_suspend_start() return code during partial resume 2017-10-15 17:05:13 +03:00
suspend_test.c
suspend_time.c
swap.c
user.c
userwakelock.c
wakelock.c PM / Sleep: User space wakeup sources garbage collector Kconfig option 2017-10-15 15:46:57 +03:00
wakeup_reason.c wakeup_reason: use vsnprintf instead of snprintf for vargs. 2017-10-15 17:05:12 +03:00