From 6365c6e3043825d2dd62b439ccad7a2b0ecf4cac Mon Sep 17 00:00:00 2001 From: Stepan Moskovchenko Date: Tue, 9 Jul 2013 16:59:15 -0700 Subject: [PATCH] PM / Sleep: Clean up remnants of workqueue-based sync When legacy wakelock code was removed in commit f85607a715a74c65db812cd3901022888257f966, some of the code for moving calls to sys_sync() from suspend paths into a workqueue item had not been properly removed. Specifically, one of the call sites to suspend_sys_sync_wait() has been mistakenly replaced with a call to sys_sync(), which is not necessary because the corresponding instance of suspend_sys_sync_queue() was already replaced with sys_sync(). Clean up the remnants of the legacy wakelock code by removing the extraneous call to sys_sync() and restoring some of the surrounding printk statements that had been moved to suspend_sys_sync_queue() and subsequently lost. CRs-Fixed: 498669 Change-Id: Ifb2ede7808560f456c824d3d6359a4541c51b73f Signed-off-by: Stepan Moskovchenko --- kernel/power/earlysuspend.c | 6 +++++- kernel/power/process.c | 4 ---- kernel/power/suspend.c | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/kernel/power/earlysuspend.c b/kernel/power/earlysuspend.c index 7d119d6080c7..35d299d626f5 100644 --- a/kernel/power/earlysuspend.c +++ b/kernel/power/earlysuspend.c @@ -17,6 +17,7 @@ #include #include #include +#include /* sys_sync */ #include #include @@ -109,7 +110,10 @@ static void early_suspend(struct work_struct *work) } mutex_unlock(&early_suspend_lock); - suspend_sys_sync_queue(); + if (debug_mask & DEBUG_SUSPEND) + pr_info("early_suspend: sync\n"); + + sys_sync(); abort: spin_lock_irqsave(&state_lock, irqflags); if (state == SUSPEND_REQUESTED_AND_SUSPENDED) diff --git a/kernel/power/process.c b/kernel/power/process.c index 3011210d68e8..d98fa18542e8 100644 --- a/kernel/power/process.c +++ b/kernel/power/process.c @@ -164,10 +164,6 @@ int freeze_kernel_threads(void) { int error; - error = sys_sync(); - if (error) - return error; - printk("Freezing remaining freezable tasks ... "); pm_nosig_freezing = true; error = try_to_freeze_tasks(false); diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index 424a3895eafa..172e4155b7fe 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c @@ -279,7 +279,10 @@ static int enter_state(suspend_state_t state) if (!mutex_trylock(&pm_mutex)) return -EBUSY; + printk(KERN_INFO "PM: Syncing filesystems ... "); sys_sync(); + printk("done.\n"); + pr_debug("PM: Preparing system for %s sleep\n", pm_states[state]); error = suspend_prepare(); if (error)