aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/printk.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-04-19 17:17:34 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-04-19 17:17:34 +0100
commitcf816ecb533ab96b883dfdc0db174598b5b5c4d2 (patch)
tree1b7705db288ae2917105e624b01fdf81e0882bf1 /kernel/printk.c
parentMerge branch 'omap2-upstream' into devel (diff)
parent[ARM] Remove leds-tosa.c (diff)
downloadlinux-dev-cf816ecb533ab96b883dfdc0db174598b5b5c4d2.tar.xz
linux-dev-cf816ecb533ab96b883dfdc0db174598b5b5c4d2.zip
Merge branch 'merge-fixes' into devel
Diffstat (limited to 'kernel/printk.c')
-rw-r--r--kernel/printk.c17
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)
{
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;