lkml.org 
[lkml]   [2010]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 07/13] tty: give up BTM in acquire_console_sem
Date
This was not caught in the initial sweep through
the TTY layer, nor by lockdep, which does not know
about classic semaphores.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
kernel/printk.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/kernel/printk.c b/kernel/printk.c
index 75077ad..30669a3 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -970,7 +970,16 @@ void resume_console(void)
void acquire_console_sem(void)
{
BUG_ON(in_interrupt());
- down(&console_sem);
+ if (down_trylock(&console_sem)) {
+ /*
+ * we may get called here with the BTM held.
+ * it's not clear whether we get the BTM while
+ * holding console_sem, need to check.
+ */
+ release_tty_lock(current);
+ down(&console_sem);
+ reacquire_tty_lock(current);
+ }
if (console_suspended)
return;
console_locked = 1;
--
1.7.0.4


\
 
 \ /
  Last update: 2010-05-05 00:37    [W:0.113 / U:12.716 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site