summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSachin Kamat <sachin.kamat@linaro.org>2011-08-23 12:32:01 +0530
committerJohn Stultz <john.stultz@linaro.org>2011-08-26 09:59:38 -0700
commit3b728cae2f6a04b80c0df33a874b141d14a3d965 (patch)
treec5ecce34e7ff9729289191d7385858131911a18e
parent312effedac183148411c965e20a62e73f23979f6 (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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/power/consoleearlysuspend.c b/kernel/power/consoleearlysuspend.c
index 3f0c8685fe1..b30f165ef4f 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;
console_unlock();
+ 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 = {