ia64/xen-unstable

changeset 4838:9143c15ed7c3

bitkeeper revision 1.1389.15.5 (4280e522q2MiQniUbfWd_2b5yEMlkA)

Fix acknowledgement of level-triggered IOAPIC interrupts. This is a
second checkin, after disentangling from aborted and utterly broken
PCI-MSI changes.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue May 10 16:45:22 2005 +0000 (2005-05-10)
parents e2f39ab492f6
children a5b33d336f17
files xen/arch/x86/io_apic.c xen/include/asm-x86/io_apic.h
line diff
     1.1 --- a/xen/arch/x86/io_apic.c	Tue May 10 16:35:45 2005 +0000
     1.2 +++ b/xen/arch/x86/io_apic.c	Tue May 10 16:45:22 2005 +0000
     1.3 @@ -145,16 +145,16 @@ static void __unmask_IO_APIC_irq (unsign
     1.4  	__modify_IO_APIC_irq(irq, 0, 0x00010000);
     1.5  }
     1.6  
     1.7 -/* mask = 1, trigger = 0 */
     1.8 -static void __mask_and_edge_IO_APIC_irq (unsigned int irq)
     1.9 +/* trigger = 0 */
    1.10 +static void __edge_IO_APIC_irq (unsigned int irq)
    1.11  {
    1.12 -	__modify_IO_APIC_irq(irq, 0x00010000, 0x00008000);
    1.13 +	__modify_IO_APIC_irq(irq, 0, 0x00008000);
    1.14  }
    1.15  
    1.16 -/* mask = 0, trigger = 1 */
    1.17 -static void __unmask_and_level_IO_APIC_irq (unsigned int irq)
    1.18 +/* trigger = 1 */
    1.19 +static void __level_IO_APIC_irq (unsigned int irq)
    1.20  {
    1.21 -	__modify_IO_APIC_irq(irq, 0x00008000, 0x00010000);
    1.22 +	__modify_IO_APIC_irq(irq, 0x00008000, 0);
    1.23  }
    1.24  
    1.25  static void mask_IO_APIC_irq (unsigned int irq)
    1.26 @@ -1637,12 +1637,14 @@ static unsigned int startup_level_ioapic
    1.27  	return 0; /* don't check for pending */
    1.28  }
    1.29  
    1.30 -static void end_level_ioapic_irq (unsigned int irq)
    1.31 +static void mask_and_ack_level_ioapic_irq (unsigned int irq)
    1.32  {
    1.33  	unsigned long v;
    1.34  	int i;
    1.35  
    1.36  	move_irq(irq);
    1.37 +
    1.38 +	mask_IO_APIC_irq(irq);
    1.39  /*
    1.40   * It appears there is an erratum which affects at least version 0x11
    1.41   * of I/O APIC (that's the 82093AA and cores integrated into various
    1.42 @@ -1671,12 +1673,17 @@ static void end_level_ioapic_irq (unsign
    1.43  	if (!(v & (1 << (i & 0x1f)))) {
    1.44  		atomic_inc(&irq_mis_count);
    1.45  		spin_lock(&ioapic_lock);
    1.46 -		__mask_and_edge_IO_APIC_irq(irq);
    1.47 -		__unmask_and_level_IO_APIC_irq(irq);
    1.48 +		__edge_IO_APIC_irq(irq);
    1.49 +		__level_IO_APIC_irq(irq);
    1.50  		spin_unlock(&ioapic_lock);
    1.51  	}
    1.52  }
    1.53  
    1.54 +static void end_level_ioapic_irq (unsigned int irq)
    1.55 +{
    1.56 +	unmask_IO_APIC_irq(irq);
    1.57 +}
    1.58 +
    1.59  #ifdef CONFIG_PCI_MSI
    1.60  static unsigned int startup_edge_ioapic_vector(unsigned int vector)
    1.61  {
    1.62 @@ -1699,6 +1706,13 @@ static unsigned int startup_level_ioapic
    1.63  	return startup_level_ioapic_irq (irq);
    1.64  }
    1.65  
    1.66 +static void mask_and_ack_level_ioapic_vector (unsigned int vector)
    1.67 +{
    1.68 +	int irq = vector_to_irq(vector);
    1.69 +
    1.70 +	mask_and_ack_level_ioapic_irq(irq);
    1.71 +}
    1.72 +
    1.73  static void end_level_ioapic_vector (unsigned int vector)
    1.74  {
    1.75  	int irq = vector_to_irq(vector);
     2.1 --- a/xen/include/asm-x86/io_apic.h	Tue May 10 16:35:45 2005 +0000
     2.2 +++ b/xen/include/asm-x86/io_apic.h	Tue May 10 16:45:22 2005 +0000
     2.3 @@ -17,7 +17,6 @@
     2.4  #ifdef CONFIG_PCI_MSI
     2.5  static inline int use_pci_vector(void)	{return 1;}
     2.6  static inline void disable_edge_ioapic_vector(unsigned int vector) { }
     2.7 -static inline void mask_and_ack_level_ioapic_vector(unsigned int vector) { }
     2.8  static inline void end_edge_ioapic_vector (unsigned int vector) { }
     2.9  #define startup_level_ioapic	startup_level_ioapic_vector
    2.10  #define shutdown_level_ioapic	mask_IO_APIC_vector
    2.11 @@ -36,7 +35,6 @@ static inline void end_edge_ioapic_vecto
    2.12  #else
    2.13  static inline int use_pci_vector(void)	{return 0;}
    2.14  static inline void disable_edge_ioapic_irq(unsigned int irq) { }
    2.15 -static inline void mask_and_ack_level_ioapic_irq(unsigned int irq) { }
    2.16  static inline void end_edge_ioapic_irq (unsigned int irq) { }
    2.17  #define startup_level_ioapic	startup_level_ioapic_irq
    2.18  #define shutdown_level_ioapic	mask_IO_APIC_irq