From: Keir Fraser Date: Thu, 6 Dec 2007 17:44:35 +0000 (+0000) Subject: On pirq enable/disable we fully unregister/reregister with Xen. This X-Git-Tag: 3.1.3-rc1~70 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=4e4b5cfd5e0e2b95eab8b01b09633d0d198e2b06;p=people%2Fvhanquez%2Fxen.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 linux-2.6.18-xen changeset: 313:51b2b0d0921c3aefb18e16a2eda68a5c3133e949 linux-2.6.18-xen date: Wed Nov 21 09:41:11 2007 +0000 --- diff --git a/linux-2.6-xen-sparse/drivers/xen/core/evtchn.c b/linux-2.6-xen-sparse/drivers/xen/core/evtchn.c index fda12a3f3..7661bbf1b 100644 --- a/linux-2.6-xen-sparse/drivers/xen/core/evtchn.c +++ b/linux-2.6-xen-sparse/drivers/xen/core/evtchn.c @@ -778,20 +778,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) @@ -810,7 +801,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)); }