diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2011-08-23 12:32:01 +0530 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2011-10-19 11:37:58 -0700 |
commit | 4d101a8f02fa690305677e54da9e3a0c5e5d9da6 (patch) | |
tree | 896f83616de5762d8d93f1ccc79e01d7d3586153 | |
parent | 437ae2287e43a6c6d51da3fb87c5dd6a1975b843 (diff) |
consoleearlysuspend: Fix warning messages during early suspend
While testing suspend/resume on Samsung SMDKV310 and Origen boards it has been
found that while system tries to enter into suspend, during console early
suspend there is warning message due to unbalance in tty locks. Due to this
sometimes system fails to enter into suspend, this patch fixes the tty mutex
unbalancing.
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
-rw-r--r-- | kernel/power/consoleearlysuspend.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/power/consoleearlysuspend.c b/kernel/power/consoleearlysuspend.c index a3edcb26738..447c11b0a9c 100644 --- a/kernel/power/consoleearlysuspend.c +++ b/kernel/power/consoleearlysuspend.c @@ -33,8 +33,11 @@ static void console_early_suspend(struct early_suspend *h) goto err; release_console_sem(); + tty_lock(); if (vt_waitactive(EARLY_SUSPEND_CONSOLE + 1)) pr_warning("console_early_suspend: Can't switch VCs.\n"); + tty_unlock(); + return; err: pr_warning("console_early_suspend: Can't set console\n"); @@ -52,8 +55,11 @@ static void console_late_resume(struct early_suspend *h) return; } + tty_lock(); if (vt_waitactive(orig_fgconsole + 1)) pr_warning("console_late_resume: Can't switch VCs.\n"); + tty_unlock(); + } static struct early_suspend console_early_suspend_desc = { |