ia64/xen-unstable

changeset 19278:3fd8f9b34941

Do not deadlock in scheduler when sending VIRQ_CON_RING.
Instead defer the virq notification to tasklet context.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Mar 06 14:28:27 2009 +0000 (2009-03-06)
parents cff29d694a89
children a44751edcb76
files xen/drivers/char/console.c
line diff
     1.1 --- a/xen/drivers/char/console.c	Thu Mar 05 17:50:05 2009 +0000
     1.2 +++ b/xen/drivers/char/console.c	Fri Mar 06 14:28:27 2009 +0000
     1.3 @@ -315,6 +315,12 @@ static void serial_rx(char c, struct cpu
     1.4      __serial_rx(c, regs);
     1.5  }
     1.6  
     1.7 +static void notify_dom0_con_ring(unsigned long unused)
     1.8 +{
     1.9 +    send_guest_global_virq(dom0, VIRQ_CON_RING);
    1.10 +}
    1.11 +static DECLARE_TASKLET(notify_dom0_con_ring_tasklet, notify_dom0_con_ring, 0);
    1.12 +
    1.13  static long guest_console_write(XEN_GUEST_HANDLE(char) buffer, int count)
    1.14  {
    1.15      char kbuf[128], *kptr;
    1.16 @@ -348,7 +354,7 @@ static long guest_console_write(XEN_GUES
    1.17          {
    1.18              for ( kptr = kbuf; *kptr != '\0'; kptr++ )
    1.19                  putchar_console_ring(*kptr);
    1.20 -            send_guest_global_virq(dom0, VIRQ_CON_RING);
    1.21 +            tasklet_schedule(&notify_dom0_con_ring_tasklet);
    1.22          }
    1.23  
    1.24          spin_unlock_irq(&console_lock);
    1.25 @@ -426,7 +432,7 @@ static void __putstr(const char *str)
    1.26      while ( (c = *str++) != '\0' )
    1.27          putchar_console_ring(c);
    1.28  
    1.29 -    send_guest_global_virq(dom0, VIRQ_CON_RING);
    1.30 +    tasklet_schedule(&notify_dom0_con_ring_tasklet);
    1.31  }
    1.32  
    1.33  static int printk_prefix_check(char *p, char **pp)