Messages in this thread Patch in this message | | | From | Arnd Bergmann <> | Subject | [PATCH 07/13] tty: give up BTM in acquire_console_sem | Date | Wed, 5 May 2010 00:33:46 +0200 |
| |
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
| |