Make c/s 21089 work again with c/s 21092
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 13 Apr 2010 14:38:27 +0000 (15:38 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 13 Apr 2010 14:38:27 +0000 (15:38 +0100)
Unfortunately the latter c/s' change to mpparse.c yielded the former
patch non-functional - Xen's serial port IRQ is not in IQR_DISABLED
state, yet must be allowed to get its trigger mode and polarity set
up in order for it to be usable.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen/arch/x86/mpparse.c

index 95aff543f245dd41f1993ef0d7662083469b3cbb..a7007d64d0576360174b24b80e649e5d92fecf03 100644 (file)
@@ -1103,6 +1103,8 @@ int mp_register_gsi (u32 gsi, int triggering, int polarity)
        int                     ioapic = -1;
        int                     ioapic_pin = 0;
        int                     idx, bit = 0;
+       struct irq_desc *       desc;
+       unsigned long           flags;
 
        /*
         * Mapping between Global System Interrups, which
@@ -1127,8 +1129,13 @@ int mp_register_gsi (u32 gsi, int triggering, int polarity)
        if (ioapic_renumber_irq)
                gsi = ioapic_renumber_irq(ioapic, gsi);
 
-       if (!(irq_to_desc(gsi)->status & IRQ_DISABLED))
+       desc = irq_to_desc(gsi);
+       spin_lock_irqsave(&desc->lock, flags);
+       if (!(desc->status & IRQ_DISABLED) && desc->handler != &no_irq_type) {
+               spin_unlock_irqrestore(&desc->lock, flags);
                return -EEXIST;
+       }
+       spin_unlock_irqrestore(&desc->lock, flags);
 
        /* 
         * Avoid pin reprogramming.  PRTs typically include entries