diff options
author | Arve Hjønnevåg <arve@android.com> | 2008-10-14 16:02:39 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2011-06-14 09:08:43 -0700 |
commit | 677f10402f85bfab6b540f6e3f64cca7f7cb79a4 (patch) | |
tree | 6037d617a2fcfbe372125a0632ce71700c5136fa /kernel | |
parent | 47dfb46bf609015a383206417c8e596df1d84017 (diff) | |
download | kernel_samsung_crespo-677f10402f85bfab6b540f6e3f64cca7f7cb79a4.zip kernel_samsung_crespo-677f10402f85bfab6b540f6e3f64cca7f7cb79a4.tar.gz kernel_samsung_crespo-677f10402f85bfab6b540f6e3f64cca7f7cb79a4.tar.bz2 |
PM: wakelock: Abort task freezing if a wake lock is held.
Avoids a problem where the device sometimes hangs for 20 seconds
before the screen is turned on.
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/power/process.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/kernel/power/process.c b/kernel/power/process.c index 0cf3a27..be2caaa 100644 --- a/kernel/power/process.c +++ b/kernel/power/process.c @@ -16,6 +16,7 @@ #include <linux/freezer.h> #include <linux/delay.h> #include <linux/workqueue.h> +#include <linux/wakelock.h> /* * Timeout for stopping processes @@ -82,6 +83,10 @@ static int try_to_freeze_tasks(bool sig_only) todo += wq_busy; } + if (todo && has_wake_lock(WAKE_LOCK_SUSPEND)) { + wakeup = 1; + break; + } if (!todo || time_after(jiffies, end_time)) break; @@ -108,13 +113,18 @@ static int try_to_freeze_tasks(bool sig_only) * and caller must call thaw_processes() if something fails), * but it cleans up leftover PF_FREEZE requests. */ - printk("\n"); - printk(KERN_ERR "Freezing of tasks %s after %d.%02d seconds " - "(%d tasks refusing to freeze, wq_busy=%d):\n", - wakeup ? "aborted" : "failed", - elapsed_csecs / 100, elapsed_csecs % 100, - todo - wq_busy, wq_busy); - + if(wakeup) { + printk("\n"); + printk(KERN_ERR "Freezing of %s aborted\n", + sig_only ? "user space " : "tasks "); + } + else { + printk("\n"); + printk(KERN_ERR "Freezing of tasks failed after %d.%02d seconds " + "(%d tasks refusing to freeze, wq_busy=%d):\n", + elapsed_csecs / 100, elapsed_csecs % 100, + todo - wq_busy, wq_busy); + } thaw_workqueues(); read_lock(&tasklist_lock); |