ia64/xen-unstable

changeset 4996:65f0179fc567

bitkeeper revision 1.1159.258.138 (428bb692pAqBH2bNfpxOYMXMKwbIsw)

Move magic sysrq from workqueue to softirq context so that its more likely to work if the system is in a bad state.
author iap10@freefall.cl.cam.ac.uk
date Wed May 18 21:41:38 2005 +0000 (2005-05-18)
parents aa22e2575a10
children c4a2aa6da442 47166e28f279
files linux-2.6.11-xen-sparse/arch/xen/kernel/reboot.c
line diff
     1.1 --- a/linux-2.6.11-xen-sparse/arch/xen/kernel/reboot.c	Wed May 18 16:59:25 2005 +0000
     1.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/kernel/reboot.c	Wed May 18 21:41:38 2005 +0000
     1.3 @@ -52,7 +52,6 @@ EXPORT_SYMBOL(machine_power_off);
     1.4  
     1.5  /* Ignore multiple shutdown requests. */
     1.6  static int shutting_down = -1;
     1.7 -static int pending_sysrq = -1;
     1.8  
     1.9  static void __do_suspend(void)
    1.10  {
    1.11 @@ -216,24 +215,23 @@ static void __shutdown_handler(void *unu
    1.12      }
    1.13  }
    1.14  
    1.15 -static void __sysrq_handler(void *unused)
    1.16 -{
    1.17 -#ifdef CONFIG_MAGIC_SYSRQ
    1.18 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
    1.19 -    handle_sysrq(pending_sysrq, NULL, NULL);
    1.20 -#else
    1.21 -    handle_sysrq(pending_sysrq, NULL, NULL, NULL);
    1.22 -#endif
    1.23 -#endif
    1.24 -    pending_sysrq = -1;
    1.25 -}
    1.26 -
    1.27  static void shutdown_handler(ctrl_msg_t *msg, unsigned long id)
    1.28  {
    1.29      static DECLARE_WORK(shutdown_work, __shutdown_handler, NULL);
    1.30 -    static DECLARE_WORK(sysrq_work, __sysrq_handler, NULL);
    1.31  
    1.32 -    if ( (shutting_down == -1) &&
    1.33 +    if ( msg->subtype == CMSG_SHUTDOWN_SYSRQ )
    1.34 +    {
    1.35 +	int sysrq = ((shutdown_sysrq_t *)&msg->msg[0])->key;
    1.36 +	
    1.37 +#ifdef CONFIG_MAGIC_SYSRQ
    1.38 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
    1.39 +	handle_sysrq(sysrq, NULL, NULL);
    1.40 +#else
    1.41 +	handle_sysrq(sysrq, NULL, NULL, NULL);
    1.42 +#endif
    1.43 +#endif
    1.44 +    }
    1.45 +    else if ( (shutting_down == -1) &&
    1.46           ((msg->subtype == CMSG_SHUTDOWN_POWEROFF) ||
    1.47            (msg->subtype == CMSG_SHUTDOWN_REBOOT) ||
    1.48            (msg->subtype == CMSG_SHUTDOWN_SUSPEND)) )
    1.49 @@ -241,12 +239,6 @@ static void shutdown_handler(ctrl_msg_t 
    1.50          shutting_down = msg->subtype;
    1.51          schedule_work(&shutdown_work);
    1.52      }
    1.53 -    else if ( (pending_sysrq == -1) && 
    1.54 -              (msg->subtype == CMSG_SHUTDOWN_SYSRQ) )
    1.55 -    {
    1.56 -        pending_sysrq = ((shutdown_sysrq_t *)&msg->msg[0])->key;
    1.57 -        schedule_work(&sysrq_work);
    1.58 -    }
    1.59      else
    1.60      {
    1.61          printk("Ignore spurious shutdown request\n");