Skip to content

Commit

Permalink
printk: Make console_sem a semaphore not a pseudo mutex
Browse files Browse the repository at this point in the history
It needs to be investigated whether it can be replaced by a real
mutex, but that needs more thought.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Christoph Hellwig <hch@infradead.org>
LKML-Reference: <20100907125057.179587334@linutronix.de>
  • Loading branch information
Thomas Gleixner committed Oct 12, 2010
1 parent 8192b1f commit 5b8c4f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ EXPORT_SYMBOL(oops_in_progress);
* provides serialisation for access to the entire console
* driver system.
*/
static DECLARE_MUTEX(console_sem);
static DEFINE_SEMAPHORE(console_sem);
struct console *console_drivers;
EXPORT_SYMBOL_GPL(console_drivers);

Expand Down Expand Up @@ -556,7 +556,7 @@ static void zap_locks(void)
/* If a crash is occurring, make sure we can't deadlock */
spin_lock_init(&logbuf_lock);
/* And make sure that we print immediately */
init_MUTEX(&console_sem);
sema_init(&console_sem, 1);
}

#if defined(CONFIG_PRINTK_TIME)
Expand Down

0 comments on commit 5b8c4f2

Please sign in to comment.