From: Keir Fraser Date: Wed, 21 Nov 2007 09:41:11 +0000 (+0000) Subject: On pirq enable/disable we fully unregister/reregister with Xen. This X-Git-Tag: xen-3.2.0~21^2^2~28^2^2~22^2^2~9^2 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=cccf45784472a8f53ad75a8a9b885ef1b6af3fee;p=xenclient%2Fkernel.git 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 Signed-off-by: Keir Fraser --- diff --git a/drivers/xen/core/evtchn.c b/drivers/xen/core/evtchn.c index 6e83ca2d..1b777c56 100644 --- a/drivers/xen/core/evtchn.c +++ b/drivers/xen/core/evtchn.c @@ -782,20 +782,11 @@ static void shutdown_pirq(unsigned int irq) static void enable_pirq(unsigned int irq) { - int evtchn = evtchn_from_irq(irq); - - if (VALID_EVTCHN(evtchn)) { - unmask_evtchn(evtchn); - pirq_unmask_notify(irq_to_pirq(irq)); - } + startup_pirq(irq); } static void disable_pirq(unsigned int irq) { - int evtchn = evtchn_from_irq(irq); - - if (VALID_EVTCHN(evtchn)) - mask_evtchn(evtchn); } static void ack_pirq(unsigned int irq) @@ -814,7 +805,10 @@ static void end_pirq(unsigned int irq) { int evtchn = evtchn_from_irq(irq); - if (VALID_EVTCHN(evtchn) && !(irq_desc[irq].status & IRQ_DISABLED)) { + if ((irq_desc[irq].status & (IRQ_DISABLED|IRQ_PENDING)) == + (IRQ_DISABLED|IRQ_PENDING)) { + shutdown_pirq(irq); + } else if (VALID_EVTCHN(evtchn)) { unmask_evtchn(evtchn); pirq_unmask_notify(irq_to_pirq(irq)); }