Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 131656
b: refs/heads/master
c: 403f307
h: refs/heads/master
v: v3
  • Loading branch information
Arve Hjønnevåg authored and Linus Torvalds committed Feb 21, 2009
1 parent 8ece3dc commit 77c3b2b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 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: b090f9fa53d51c8a33370071de9e391919ee1fa7
refs/heads/master: 403f307576396f3362fbb65af190885b6036c72c
15 changes: 9 additions & 6 deletions trunk/kernel/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ EXPORT_SYMBOL(oops_in_progress);
* driver system.
*/
static DECLARE_MUTEX(console_sem);
static DECLARE_MUTEX(secondary_console_sem);
struct console *console_drivers;
EXPORT_SYMBOL_GPL(console_drivers);

Expand Down Expand Up @@ -891,12 +890,14 @@ void suspend_console(void)
printk("Suspending console(s) (use no_console_suspend to debug)\n");
acquire_console_sem();
console_suspended = 1;
up(&console_sem);
}

void resume_console(void)
{
if (!console_suspend_enabled)
return;
down(&console_sem);
console_suspended = 0;
release_console_sem();
}
Expand All @@ -912,11 +913,9 @@ void resume_console(void)
void acquire_console_sem(void)
{
BUG_ON(in_interrupt());
if (console_suspended) {
down(&secondary_console_sem);
return;
}
down(&console_sem);
if (console_suspended)
return;
console_locked = 1;
console_may_schedule = 1;
}
Expand All @@ -926,6 +925,10 @@ int try_acquire_console_sem(void)
{
if (down_trylock(&console_sem))
return -1;
if (console_suspended) {
up(&console_sem);
return -1;
}
console_locked = 1;
console_may_schedule = 0;
return 0;
Expand Down Expand Up @@ -979,7 +982,7 @@ void release_console_sem(void)
unsigned wake_klogd = 0;

if (console_suspended) {
up(&secondary_console_sem);
up(&console_sem);
return;
}

Expand Down

0 comments on commit 77c3b2b

Please sign in to comment.