ia64/linux-2.6.18-xen.hg

changeset 315:51b2b0d0921c

On pirq enable/disable we fully unregister/reregister with Xen. This
causes the underlying IRQ to be properly masked/unmasked, thus
avoiding deadlock scenarios if the IRQ is not EOIed.
Based on a patch by Chris Lalancette <clalance@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Nov 21 09:41:11 2007 +0000 (2007-11-21)
parents 037c44559e55
children dea67c1a8efa
files drivers/xen/core/evtchn.c
line diff
     1.1 --- a/drivers/xen/core/evtchn.c	Tue Nov 20 17:30:31 2007 +0000
     1.2 +++ b/drivers/xen/core/evtchn.c	Wed Nov 21 09:41:11 2007 +0000
     1.3 @@ -782,20 +782,11 @@ static void shutdown_pirq(unsigned int i
     1.4  
     1.5  static void enable_pirq(unsigned int irq)
     1.6  {
     1.7 -	int evtchn = evtchn_from_irq(irq);
     1.8 -
     1.9 -	if (VALID_EVTCHN(evtchn)) {
    1.10 -		unmask_evtchn(evtchn);
    1.11 -		pirq_unmask_notify(irq_to_pirq(irq));
    1.12 -	}
    1.13 +	startup_pirq(irq);
    1.14  }
    1.15  
    1.16  static void disable_pirq(unsigned int irq)
    1.17  {
    1.18 -	int evtchn = evtchn_from_irq(irq);
    1.19 -
    1.20 -	if (VALID_EVTCHN(evtchn))
    1.21 -		mask_evtchn(evtchn);
    1.22  }
    1.23  
    1.24  static void ack_pirq(unsigned int irq)
    1.25 @@ -814,7 +805,10 @@ static void end_pirq(unsigned int irq)
    1.26  {
    1.27  	int evtchn = evtchn_from_irq(irq);
    1.28  
    1.29 -	if (VALID_EVTCHN(evtchn) && !(irq_desc[irq].status & IRQ_DISABLED)) {
    1.30 +	if ((irq_desc[irq].status & (IRQ_DISABLED|IRQ_PENDING)) ==
    1.31 +	    (IRQ_DISABLED|IRQ_PENDING)) {
    1.32 +		shutdown_pirq(irq);
    1.33 +	} else if (VALID_EVTCHN(evtchn)) {
    1.34  		unmask_evtchn(evtchn);
    1.35  		pirq_unmask_notify(irq_to_pirq(irq));
    1.36  	}