Commit Graph

14 Commits

Author SHA1 Message Date
黄涛
c6e6466d05 power: fix lcd resume taking long time with an ongoing file copy
port from msm:
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.
2011-12-28 14:46:00 +08:00
黄涛
8aac13f440 Merge remote-tracking branch 'remotes/aosp/android-3.0' into develop-3.0
Conflicts:
	drivers/mmc/card/block.c
	drivers/net/usb/asix.c
	drivers/net/wireless/airo.c
	drivers/net/wireless/ath/ath5k/base.c
	drivers/net/wireless/ath/ath9k/ar9002_calib.c
	drivers/net/wireless/ath/ath9k/ar9002_hw.c
	drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
	drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
	drivers/net/wireless/ath/ath9k/ar9003_hw.c
	drivers/net/wireless/ath/ath9k/ar9003_phy.h
	drivers/net/wireless/ath/ath9k/hw.c
	drivers/net/wireless/ath/ath9k/hw.h
	drivers/net/wireless/ath/ath9k/init.c
	drivers/net/wireless/ath/ath9k/main.c
	drivers/net/wireless/ath/ath9k/pci.c
	drivers/net/wireless/b43/main.c
	drivers/net/wireless/hostap/hostap_main.c
	drivers/net/wireless/iwlwifi/iwl-5000.c
	drivers/net/wireless/iwlwifi/iwl-agn.c
	drivers/net/wireless/iwlwifi/iwl-core.h
	drivers/net/wireless/iwlwifi/iwl-power.c
	drivers/net/wireless/iwlwifi/iwl-scan.c
	drivers/net/wireless/iwlwifi/iwl-tx.c
	drivers/net/wireless/rt2x00/rt2800lib.c
	drivers/net/wireless/rt2x00/rt2800usb.c
	drivers/net/wireless/rt2x00/rt2x00mac.c
	drivers/net/wireless/rt2x00/rt2x00queue.c
	drivers/net/wireless/rt2x00/rt2x00queue.h
	drivers/net/wireless/rt2x00/rt2x00usb.c
	drivers/usb/serial/option.c
2011-11-09 13:06:28 +08:00
黄涛
1bcabbad76 Revert "temp revert rk change"
This reverts commit 15f7fabcb8.

Conflicts:

	.gitignore
	arch/arm/boot/compressed/head.S
	arch/arm/common/gic.c
	arch/arm/kernel/Makefile
	arch/arm/mm/proc-v7.S
	arch/arm/tools/mach-types
	arch/arm/vfp/vfphw.S
	drivers/Kconfig
	drivers/Makefile
	drivers/char/Makefile
	drivers/cpufreq/cpufreq_ondemand.c
	drivers/gpio/gpiolib.c
	drivers/gpio/tps65910-gpio.c
	drivers/input/Makefile
	drivers/input/keyboard/Kconfig
	drivers/input/keyboard/Makefile
	drivers/input/touchscreen/Kconfig
	drivers/media/video/Makefile
	drivers/media/video/ov2640.c
	drivers/media/video/soc_camera.c
	drivers/media/video/uvc/uvc_v4l2.c
	drivers/media/video/v4l2-ioctl.c
	drivers/mfd/Kconfig
	drivers/mfd/Makefile
	drivers/mfd/wm831x-core.c
	drivers/mfd/wm831x-i2c.c
	drivers/mfd/wm831x-irq.c
	drivers/mfd/wm831x-spi.c
	drivers/mfd/wm8994-core.c
	drivers/misc/Kconfig
	drivers/misc/Makefile
	drivers/misc/pmem.c
	drivers/mmc/card/block.c
	drivers/mmc/core/core.c
	drivers/mmc/core/mmc.c
	drivers/mmc/core/sd.c
	drivers/mmc/core/sdio.c
	drivers/mmc/host/Makefile
	drivers/net/wireless/Kconfig
	drivers/net/wireless/Makefile
	drivers/net/wireless/bcm4329/bcmsdh_linux.c
	drivers/net/wireless/bcm4329/dhd.h
	drivers/net/wireless/bcm4329/dhd_linux.c
	drivers/net/wireless/bcm4329/wl_iw.c
	drivers/net/wireless/bcm4329/wl_iw.h
	drivers/power/wm831x_power.c
	drivers/regulator/Makefile
	drivers/regulator/core.c
	drivers/regulator/tps65910-regulator.c
	drivers/regulator/wm831x-dcdc.c
	drivers/regulator/wm831x-isink.c
	drivers/regulator/wm831x-ldo.c
	drivers/rtc/Kconfig
	drivers/rtc/Makefile
	drivers/serial/Kconfig
	drivers/serial/Makefile
	drivers/staging/Kconfig
	drivers/staging/Makefile
	drivers/usb/Makefile
	drivers/usb/gadget/Kconfig
	drivers/usb/gadget/android.c
	drivers/usb/gadget/f_mass_storage.c
	drivers/usb/serial/option.c
	drivers/video/backlight/wm831x_bl.c
	fs/fat/dir.c
	fs/fat/fatent.c
	fs/fat/inode.c
	fs/yaffs2/yaffs_fs.c
	fs/yaffs2/yaffs_mtdif2.c
	include/linux/i2c.h
	include/linux/mfd/wm831x/core.h
	include/linux/mfd/wm831x/pdata.h
	include/linux/mfd/wm8994/core.h
	include/linux/mfd/wm8994/pdata.h
	include/linux/regulator/consumer.h
	include/media/v4l2-chip-ident.h
	kernel/power/earlysuspend.c
	kernel/power/wakelock.c
	kernel/sys.c
	mm/page_alloc.c
	sound/soc/codecs/Kconfig
	sound/soc/codecs/Makefile
	sound/soc/codecs/wm8900.c
	sound/soc/codecs/wm8988.c
	sound/soc/codecs/wm8994.c
	sound/soc/codecs/wm8994.h
	sound/soc/codecs/wm_hubs.c
	sound/soc/soc-cache.c
2011-11-04 17:43:18 +08:00
Todd Poynor
7013f49763 PM: Backoff suspend if repeated attempts fail
Change-Id: I32289676d95a307ea3aa5e78f6c126ca979c0fec
Signed-off-by: Todd Poynor <toddpoynor@google.com>
2011-09-06 13:49:57 -07:00
Todd Poynor
ca64b0cd3a PM: wakelocks: Display wakelocks preventing suspend by default
Use DEBUG_WAKEUP flag to show wakelocks that abort suspend, in
addition to showing wakelocks held during system resume.
DEBUG_WAKEUP is enabled by default.

Change-Id: If6fa68e8afbc482a5300ffab2964694b02b34f41
Signed-off-by: Todd Poynor <toddpoynor@google.com>
2011-08-10 16:14:56 -07:00
Todd Poynor
ed27e538aa PM: wakelocks: Don't report wake up wakelock if suspend aborted
If the wakelock driver aborts suspend due to an already-held
wakelock, don't report the next wakelock held as the "wake up
wakelock".

Change-Id: I582ffbb87a3c361739a77d839a0c62921cff11a6
Signed-off-by: Todd Poynor <toddpoynor@google.com>
2011-08-08 19:03:09 -07:00
Colin Cross
28e23cf73c power: wakelock: use get_xtime_and_monotonic_and_sleep_offset in get_expired_time
Change-Id: I6ebe6b954b2ff328d46898d683650dafb9c4fe74
Signed-off-by: Erik Gilling <konkers@android.com>
2011-06-14 09:09:53 -07:00
Erik Gilling
435aacd2a0 power: wakelock: call __get_wall_to_monotonic() instead of using wall_to_monotonic
Change-Id: I9e9c3b923bf9a22ffd48f80a72050289496e57d8
2011-06-14 09:09:35 -07:00
Colin Cross
0c7841ce3e wakelock: Fix operator precedence bug
Change-Id: I21366ace371d1b8f4684ddbe4ea8d555a926ac21
Signed-off-by: Colin Cross <ccross@google.com>
2011-06-14 09:09:34 -07:00
Mike Chan
af62b25adb power: wakelock: Print active wakelocks when has_wake_lock() is called
When DEBUG_SUSPEND is enabled print active wakelocks when we check
if there are any active wakelocks.

In print_active_locks(), print expired wakelocks if DEBUG_EXPIRE is enabled

Change-Id: Ib1cb795555e71ff23143a2bac7c8a58cbce16547
Signed-off-by: Mike Chan <mike@android.com>
2011-06-14 09:09:27 -07:00
Arve Hjønnevåg
1b0749512f PM: wakelocks: Use seq_file for /proc/wakelocks so we can get more than 3K of stats.
Change-Id: I42ed8bea639684f7a8a95b2057516764075c6b01
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2011-06-14 09:08:42 -07:00
Erik Gilling
10f0138c56 power: wakelocks: fix buffer overflow in print_wake_locks
Change-Id: Ic944e3b3d3bc53eddc6fd0963565fd072cac373c
Signed-off-by: Erik Gilling <konkers@android.com>
2011-06-14 09:08:42 -07:00
Mike Chan
97a0a74383 power: Prevent spinlock recursion when wake_unlock() is called
Signed-off-by: Mike Chan <mike@android.com>
2011-06-14 09:08:42 -07:00
Arve Hjønnevåg
fe6cd633ef PM: Implement wakelock api.
PM: wakelock: Replace expire work with a timer

The expire work function did not work in the normal case.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
2011-06-14 09:08:41 -07:00