Revert "PM: Abort suspend if wake_lock is acquired"
Varun Wadekar [Mon, 23 Jul 2012 08:01:12 +0000 (13:01 +0530)]
This reverts commit d97f537d271166209261ff364b64b35f0ca98ced.

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

kernel/power/earlysuspend.c
kernel/power/power.h
kernel/power/userwakelock.c

index 6a83e56..c165b33 100644 (file)
@@ -78,10 +78,6 @@ static void suspend(struct work_struct *work)
 {
        if (debug_mask & DEBUG_SUSPEND)
                pr_info("early_suspend: suspend\n");
-
-       if (pm_wakeup_pending())
-               return;
-
        pm_suspend(requested_suspend_state);
 
        /*
@@ -199,15 +195,6 @@ void request_suspend_state(suspend_state_t new_state)
        spin_unlock_irqrestore(&state_lock, irqflags);
 }
 
-void schedule_suspend_work(void)
-{
-       unsigned long irqflags;
-       spin_lock_irqsave(&state_lock, irqflags);
-       if (state & SUSPEND_REQUESTED_AND_SUSPENDED)
-               queue_delayed_work(suspend_work_queue, &suspend_work, HZ);
-       spin_unlock_irqrestore(&state_lock, irqflags);
-}
-
 suspend_state_t get_suspend_state(void)
 {
        return requested_suspend_state;
index fa264a2..3944423 100644 (file)
@@ -289,5 +289,4 @@ ssize_t  wake_unlock_store(struct kobject *kobj, struct kobj_attribute *attr,
 /* kernel/power/earlysuspend.c */
 void request_suspend_state(suspend_state_t state);
 suspend_state_t get_suspend_state(void);
-void schedule_suspend_work(void);
 #endif
index e88c5da..a28a8db 100644 (file)
@@ -212,13 +212,8 @@ ssize_t wake_unlock_store(
                pr_info("wake_unlock_store: %s\n", l->name);
 
        wake_unlock(&l->wake_lock);
-
 not_found:
        mutex_unlock(&tree_lock);
-
-       if (!pm_wakeup_pending())
-               schedule_suspend_work();
-
        return n;
 }