[PORT FROM R2] Camera: The phone is very slow to wake up if press PWR key during...
authorXiaobing Tu <xiaobing.tu@intel.com>
Thu, 22 Dec 2011 13:53:40 +0000 (08:53 -0500)
committerbuildbot <buildbot@intel.com>
Thu, 5 Jan 2012 07:33:59 +0000 (23:33 -0800)
BZ: 18955

The phone is very slow to wake up if press PWR key during camera postview

sys_sync option has a race condition with the late_resume_work.

Using wakeup_flusher_threads(0) to replace sys_sync.
since wakeup_flusher_threads(0) won't block the resume option.
Signed-off-by: Xiaobing Tu <xiaobing.tu@intel.com>
Change-Id: I4bbe017a65f56afbc058b28c8cce8db4512e4907
Orig-Change-Id: Id33abbf7eda4167b17ace16309fca530d3815f70
Reviewed-on: http://android.intel.com:8080/29663
Reviewed-by: Zhang, Yanmin <yanmin.zhang@intel.com>
Reviewed-by: Tu, Xiaobing <xiaobing.tu@intel.com>
Reviewed-by: Mansoor, Illyas <illyas.mansoor@intel.com>
Reviewed-by: Hogander, Jouni <jouni.hogander@intel.com>
Tested-by: Martin, LoicX <loicx.martin@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
Reviewed-on: http://android.intel.com:8080/30511
Reviewed-by: Lampila, KalleX <kallex.lampila@intel.com>
Reviewed-by: Koski, Anttu <anttu.koski@intel.com>
Tested-by: Koski, Anttu <anttu.koski@intel.com>
kernel/power/earlysuspend.c

index b15f02e..69f7834 100644 (file)
@@ -17,7 +17,7 @@
 #include <linux/module.h>
 #include <linux/mutex.h>
 #include <linux/rtc.h>
-#include <linux/syscalls.h> /* sys_sync */
+#include <linux/writeback.h>
 #include <linux/wakelock.h>
 #include <linux/workqueue.h>
 
@@ -102,11 +102,10 @@ static void early_suspend(struct work_struct *work)
                }
        }
        mutex_unlock(&early_suspend_lock);
-
-       if (debug_mask & DEBUG_SUSPEND)
-               pr_info("early_suspend: sync\n");
-
-       sys_sync();
+       if(debug_mask & DEBUG_SUSPEND)
+               pr_info("early_suspend: after call handlers\n");
+       /* just wake up flusher to start write back and don't wait it finished*/
+       wakeup_flusher_threads(0);
 abort:
        spin_lock_irqsave(&state_lock, irqflags);
        if (state == SUSPEND_REQUESTED_AND_SUSPENDED)