android_kernel_google_msm/kernel/power
Pratik Patel 1ae5815864 power: fix lcd resume taking long time with an ongoing file copy
This fixes the issue where LCD takes a long time to come back up
since the execution of backlight on and late_resume works by the
suspend worker thread is delayed due to one (or more) of the
sys_sync calls in early_suspend and suspend paths taking a long
time (sometimes 15sec or more) for the below reported scenario(s):

Scenario 1 (copy with usb connected):
1. plug usb
2. adb shell
3. busybox cp /sdcard/file1 /sdcard/file2 (copy >= 100MB file1
   in sdcard/emmc to file2 in sdcard/emmc)
4. press end key to suspend
5. press end key again and it takes a long time for LCD to come
   back up

Scenario 2 (background copy):
1. plug usb
2. adb shell
3. busybox cp /sdcard/file1 /sdcard/file2 & (copy >= 100MB file1
   in sdcard/emmc to file2 in sdcard/emmc)
4. disconnect usb
5. press end key to suspend
6. press end key again and it takes a long time for LCD to come
   back up

A more common form of Scenario 2 is for the user to just use the
copy function on the UI to copy large file(s).

We address this by moving sys_sync calls to a separate workqueue
and having a timeout polling based mechanism to bail out of suspend
in case of user invoking a wakeup event (like end key press) while
we are waiting for the sys_sync completion at the synchronization
point in suspend worker thread context.

CRs-Fixed: 283994
Change-Id: I6b54af8432e58fd5442817b7388ce2e0b83354b6
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
(cherry picked from commit 8564b5ebeafa2be276e0004d7d32bd101642fb3d)

Conflicts:

	kernel/power/process.c
2013-02-20 01:32:14 -08:00
..
block_io.c
console.c
consoleearlysuspend.c PM: earlysuspend: Add console switch when user requested sleep state changes. 2013-02-20 01:31:52 -08:00
earlysuspend.c power: fix lcd resume taking long time with an ongoing file copy 2013-02-20 01:32:14 -08:00
fbearlysuspend.c PM: earlysuspend: Removing dependence on console. 2013-02-20 01:31:53 -08:00
hibernate.c PM / Sleep: Move disabling of usermode helpers to the freezer 2012-03-28 23:30:21 +02:00
Kconfig PM: Add user-space wake lock api. 2013-02-20 01:32:11 -08:00
main.c PM: Enable early suspend through /sys/power/state 2013-02-20 01:32:12 -08:00
Makefile PM: Add user-space wake lock api. 2013-02-20 01:32:11 -08:00
power.h power: fix lcd resume taking long time with an ongoing file copy 2013-02-20 01:32:14 -08:00
poweroff.c
process.c power: fix lcd resume taking long time with an ongoing file copy 2013-02-20 01:32:14 -08:00
qos.c PM / QoS: add pm_qos_update_request_timeout() API 2012-03-28 23:31:24 +02:00
snapshot.c Power management updates for 3.4 2012-03-21 10:15:51 -07:00
suspend.c power: fix lcd resume taking long time with an ongoing file copy 2013-02-20 01:32:14 -08:00
suspend_test.c
swap.c PM / Hibernate: fix the number of pages used for hibernate/thaw buffering 2012-04-24 23:53:28 +02:00
user.c PM / Sleep: Move disabling of usermode helpers to the freezer 2012-03-28 23:30:21 +02:00
userwakelock.c PM: Add user-space wake lock api. 2013-02-20 01:32:11 -08:00
wakelock.c power: fix lcd resume taking long time with an ongoing file copy 2013-02-20 01:32:14 -08:00