ia64/xen-unstable

changeset 19299:f57ac4af36b4

Avoid deadlock in tasklet_schedule() after console_force_unlock().

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Mar 09 09:56:16 2009 +0000 (2009-03-09)
parents 5997e86988f6
children b249f3e979a5
files xen/drivers/char/console.c
line diff
     1.1 --- a/xen/drivers/char/console.c	Mon Mar 09 09:49:50 2009 +0000
     1.2 +++ b/xen/drivers/char/console.c	Mon Mar 09 09:56:16 2009 +0000
     1.3 @@ -420,6 +420,8 @@ long do_console_io(int cmd, int count, X
     1.4   * *****************************************************
     1.5   */
     1.6  
     1.7 +static bool_t console_locks_busted;
     1.8 +
     1.9  static void __putstr(const char *str)
    1.10  {
    1.11      int c;
    1.12 @@ -429,10 +431,12 @@ static void __putstr(const char *str)
    1.13      sercon_puts(str);
    1.14      vga_puts(str);
    1.15  
    1.16 -    while ( (c = *str++) != '\0' )
    1.17 -        putchar_console_ring(c);
    1.18 -
    1.19 -    tasklet_schedule(&notify_dom0_con_ring_tasklet);
    1.20 +    if ( !console_locks_busted )
    1.21 +    {
    1.22 +        while ( (c = *str++) != '\0' )
    1.23 +            putchar_console_ring(c);
    1.24 +        tasklet_schedule(&notify_dom0_con_ring_tasklet);
    1.25 +    }
    1.26  }
    1.27  
    1.28  static int printk_prefix_check(char *p, char **pp)
    1.29 @@ -665,6 +669,7 @@ void console_force_unlock(void)
    1.30  {
    1.31      spin_lock_init(&console_lock);
    1.32      serial_force_unlock(sercon_handle);
    1.33 +    console_locks_busted = 1;
    1.34      console_start_sync();
    1.35  }
    1.36