Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 88336
b: refs/heads/master
c: 093a07e
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Apr 15, 2008
1 parent 2c5d6da commit 3c7e5c5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0de19a456cb59106420864927fdec152310f70b6
refs/heads/master: 093a07e2fdfaddab7fc7d4adc76cc569c86603d7
17 changes: 15 additions & 2 deletions trunk/kernel/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,8 +643,21 @@ static int acquire_console_semaphore_for_printk(unsigned int cpu)
{
int retval = 0;

if (can_use_console(cpu))
retval = !try_acquire_console_sem();
if (!try_acquire_console_sem()) {
retval = 1;

/*
* If we can't use the console, we need to release
* the console semaphore by hand to avoid flushing
* the buffer. We need to hold the console semaphore
* in order to do this test safely.
*/
if (!can_use_console(cpu)) {
console_locked = 0;
up(&console_sem);
retval = 0;
}
}
printk_cpu = UINT_MAX;
spin_unlock(&logbuf_lock);
return retval;
Expand Down

0 comments on commit 3c7e5c5

Please sign in to comment.