diff options
| author | 2013-08-15 20:43:46 +0200 | |
|---|---|---|
| committer | 2013-08-15 20:43:46 +0200 | |
| commit | f85a6597a6ce33fe4f390744b2764b30aa7bfda8 (patch) | |
| tree | 9b923afc20e7d3a7e78f98d600fd7e6633b4265b /kernel/power/process.c | |
| parent | ALSA: usb-audio: Fix invalid volume resolution for Logitech HD Webcam C525 (diff) | |
| parent | Merge remote-tracking branch 'asoc/fix/tegra' into asoc-linus (diff) | |
| download | linux-dev-f85a6597a6ce33fe4f390744b2764b30aa7bfda8.tar.xz linux-dev-f85a6597a6ce33fe4f390744b2764b30aa7bfda8.zip | |
Merge tag 'asoc-v3.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v3.11
A few driver specific fixes here plus one core fix for a memory
corruption issue in DAPM initialisation which could lead to crashes.
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(); |
