Revert "power: earlysuspend: suspend if user space is still asleep after resume"
Varun Wadekar [Mon, 23 Jul 2012 08:01:31 +0000 (13:01 +0530)]
This reverts commit afe26e084f0058a3fa4b98fb2cb8a56f1f94e0f8.

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

kernel/power/earlysuspend.c

index c165b33..cff3281 100644 (file)
@@ -39,7 +39,7 @@ static void late_resume(struct work_struct *work);
 static void suspend(struct work_struct *work);
 static DECLARE_WORK(early_suspend_work, early_suspend);
 static DECLARE_WORK(late_resume_work, late_resume);
-static DECLARE_DELAYED_WORK(suspend_work, suspend);
+static DECLARE_WORK(suspend_work, suspend);
 static DEFINE_SPINLOCK(state_lock);
 enum {
        SUSPEND_REQUESTED = 0x1,
@@ -76,18 +76,7 @@ EXPORT_SYMBOL(unregister_early_suspend);
 
 static void suspend(struct work_struct *work)
 {
-       if (debug_mask & DEBUG_SUSPEND)
-               pr_info("early_suspend: suspend\n");
-       pm_suspend(requested_suspend_state);
-
-       /*
-        * Check if we made it till late_resume. If not then this is not
-        * actual resume. Suspend again.
-        */
-       mutex_lock(&early_suspend_lock);
-       if (state & SUSPENDED)
-               queue_delayed_work(suspend_work_queue, &suspend_work, HZ);
-       mutex_unlock(&early_suspend_lock);
+        pm_suspend(requested_suspend_state);
 }
 
 static void early_suspend(struct work_struct *work)
@@ -120,13 +109,13 @@ static void early_suspend(struct work_struct *work)
                        pos->suspend(pos);
                }
        }
+       mutex_unlock(&early_suspend_lock);
 
        if (debug_mask & DEBUG_SUSPEND)
                pr_info("early_suspend: sync\n");
 
        sys_sync();
-       queue_delayed_work(suspend_work_queue, &suspend_work, HZ);
-       mutex_unlock(&early_suspend_lock);
+       queue_work(suspend_work_queue, &suspend_work);
 }
 
 static void late_resume(struct work_struct *work)