diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-05 05:41:03 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-05 05:41:03 +0800 |
| commit | 5ac1ccb70a3b7d4627c257fcbb2579b2dc4d2a0a (patch) | |
| tree | 57c9fc4aae86d6dc4dacb921e673ac6b0deac26d /kernel/power/process.c | |
| parent | a4f2dc9efc00a56ca30ce340a1405293ec9488a4 (diff) | |
| parent | c095ba7224d8edc71dcef0d655911399a8bd4a3f (diff) | |
| download | linux-next-5ac1ccb70a3b7d4627c257fcbb2579b2dc4d2a0a.tar.gz linux-next-5ac1ccb70a3b7d4627c257fcbb2579b2dc4d2a0a.zip | |
Merge 3.11-rc4 into tty-next
We want the tty fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/power/process.c')
| -rw-r--r-- | kernel/power/process.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/power/process.c b/kernel/power/process.c index fc0df8486449..06ec8869dbf1 100644 --- a/kernel/power/process.c +++ b/kernel/power/process.c @@ -109,6 +109,8 @@ static int try_to_freeze_tasks(bool user_only) /** * freeze_processes - Signal user space processes to enter the refrigerator. + * The current thread will not be frozen. The same process that calls + * freeze_processes must later call thaw_processes. * * On success, returns 0. On failure, -errno and system is fully thawed. */ @@ -120,6 +122,9 @@ int freeze_processes(void) if (error) return error; + /* Make sure this task doesn't get frozen */ + current->flags |= PF_SUSPEND_TASK; + if (!pm_freezing) atomic_inc(&system_freezing_cnt); @@ -168,6 +173,7 @@ int freeze_kernel_threads(void) void thaw_processes(void) { struct task_struct *g, *p; + struct task_struct *curr = current; if (pm_freezing) atomic_dec(&system_freezing_cnt); @@ -182,10 +188,15 @@ void thaw_processes(void) read_lock(&tasklist_lock); do_each_thread(g, p) { + /* No other threads should have PF_SUSPEND_TASK set */ + WARN_ON((p != curr) && (p->flags & PF_SUSPEND_TASK)); __thaw_task(p); } while_each_thread(g, p); read_unlock(&tasklist_lock); + WARN_ON(!(curr->flags & PF_SUSPEND_TASK)); + curr->flags &= ~PF_SUSPEND_TASK; + usermodehelper_enable(); schedule(); |
