aboutsummaryrefslogtreecommitdiffstats
path: root/xen/drivers/char/console.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-03-09 09:56:16 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-03-09 09:56:16 +0000
commit100f5738dcf45d4ca2ec7224e728b16690ac52a8 (patch)
treed21c832c319376375894966c839839edf65ea44f /xen/drivers/char/console.c
parent8591975c24920c26e6c41c2ec166c0d795668f80 (diff)
downloadxen-100f5738dcf45d4ca2ec7224e728b16690ac52a8.tar.gz
xen-100f5738dcf45d4ca2ec7224e728b16690ac52a8.tar.bz2
xen-100f5738dcf45d4ca2ec7224e728b16690ac52a8.zip
Avoid deadlock in tasklet_schedule() after console_force_unlock().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/drivers/char/console.c')
-rw-r--r--xen/drivers/char/console.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 00a32022dd..f6ce51aad8 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -420,6 +420,8 @@ long do_console_io(int cmd, int count, XEN_GUEST_HANDLE(char) buffer)
* *****************************************************
*/
+static bool_t console_locks_busted;
+
static void __putstr(const char *str)
{
int c;
@@ -429,10 +431,12 @@ static void __putstr(const char *str)
sercon_puts(str);
vga_puts(str);
- while ( (c = *str++) != '\0' )
- putchar_console_ring(c);
-
- tasklet_schedule(&notify_dom0_con_ring_tasklet);
+ if ( !console_locks_busted )
+ {
+ while ( (c = *str++) != '\0' )
+ putchar_console_ring(c);
+ tasklet_schedule(&notify_dom0_con_ring_tasklet);
+ }
}
static int printk_prefix_check(char *p, char **pp)
@@ -665,6 +669,7 @@ void console_force_unlock(void)
{
spin_lock_init(&console_lock);
serial_force_unlock(sercon_handle);
+ console_locks_busted = 1;
console_start_sync();
}