diff options
| author | Steve French <sfrench@us.ibm.com> | 2008-04-17 19:38:45 -0400 | 
|---|---|---|
| committer | Steve French <sfrench@us.ibm.com> | 2008-04-17 19:38:45 -0400 | 
| commit | 20e673810c69d18bee2ed74d19af3806ec2504f5 (patch) | |
| tree | 7c22dc5246295a82f2688a23ae1c7f3a4f424302 /kernel/printk.c | |
| parent | 8d142137b4fe87188f211042b16a5993964226f9 (diff) | |
| parent | 4b119e21d0c66c22e8ca03df05d9de623d0eb50f (diff) | |
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'kernel/printk.c')
| -rw-r--r-- | kernel/printk.c | 17 | 
1 files changed, 15 insertions, 2 deletions
| diff --git a/kernel/printk.c b/kernel/printk.c index c46a20a19a15..bdd4ea8c3f2b 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
| @@ -643,8 +643,21 @@ static int acquire_console_semaphore_for_printk(unsigned int cpu) | |||
| 643 | { | 643 | { | 
| 644 | int retval = 0; | 644 | int retval = 0; | 
| 645 | 645 | ||
| 646 | if (can_use_console(cpu)) | 646 | if (!try_acquire_console_sem()) { | 
| 647 | retval = !try_acquire_console_sem(); | 647 | retval = 1; | 
| 648 | |||
| 649 | /* | ||
| 650 | * If we can't use the console, we need to release | ||
| 651 | * the console semaphore by hand to avoid flushing | ||
| 652 | * the buffer. We need to hold the console semaphore | ||
| 653 | * in order to do this test safely. | ||
| 654 | */ | ||
| 655 | if (!can_use_console(cpu)) { | ||
| 656 | console_locked = 0; | ||
| 657 | up(&console_sem); | ||
| 658 | retval = 0; | ||
| 659 | } | ||
| 660 | } | ||
| 648 | printk_cpu = UINT_MAX; | 661 | printk_cpu = UINT_MAX; | 
| 649 | spin_unlock(&logbuf_lock); | 662 | spin_unlock(&logbuf_lock); | 
| 650 | return retval; | 663 | return retval; | 
