ia64/xen-unstable

changeset 14793:4dc14c591e6c

linux: Fix IRQ disable/enable logic across save/restore.
stop_machine_run() executes our callback function with interrupts
disabled.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Tue Apr 10 18:49:20 2007 +0100 (2007-04-10)
parents e8caf7802f3f
children 3d356a2b1c75 380db34694d7
files linux-2.6-xen-sparse/drivers/xen/core/machine_reboot.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/core/machine_reboot.c	Tue Apr 10 17:29:16 2007 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/core/machine_reboot.c	Tue Apr 10 18:49:20 2007 +0100
     1.3 @@ -127,8 +127,10 @@ static int take_machine_down(void *p_fas
     1.4  	extern void time_resume(void);
     1.5  
     1.6  	if (fast_suspend) {
     1.7 -		preempt_disable();
     1.8 +		BUG_ON(!irqs_disabled());
     1.9  	} else {
    1.10 +		BUG_ON(irqs_disabled());
    1.11 +
    1.12  		for (;;) {
    1.13  			err = smp_suspend();
    1.14  			if (err)
    1.15 @@ -143,11 +145,11 @@ static int take_machine_down(void *p_fas
    1.16  			preempt_enable();
    1.17  			xenbus_suspend_cancel();
    1.18  		}
    1.19 +
    1.20 +		local_irq_disable();
    1.21  	}
    1.22  
    1.23  	mm_pin_all();
    1.24 -	local_irq_disable();
    1.25 -	preempt_enable();
    1.26  	gnttab_suspend();
    1.27  	pre_suspend();
    1.28  
    1.29 @@ -178,7 +180,9 @@ static int take_machine_down(void *p_fas
    1.30  #endif
    1.31  	}
    1.32  	time_resume();
    1.33 -	local_irq_enable();
    1.34 +
    1.35 +	if (!fast_suspend)
    1.36 +		local_irq_enable();
    1.37  
    1.38  	return suspend_cancelled;
    1.39  }