
From: long <tlnguyen@snoqualmie.dp.intel.com>

I did some MSI tests on 2.6.5-mm3 and observed the followings:

- CONFIG_PCI_USE_VECTOR = y in both UP and SMP ==> PASS
- CONFIG_PCI_USE_VECTOR = n in UP and SMP ==> SYSTEM HANGS!

This is becasue NR_IRQ_VECTORS, which was defined as NR_VECTORS (256) was
changed to NR_IRQS (224).

As a result of this change, the vector allocator assign_irq_vector in
arch/i386/kernel/io_apic.c will hang the system when assigned vector is
greater than 224, like 238 for example since vector_irq[] has only 224
elements.


---

 25-akpm/arch/i386/kernel/io_apic.c |    2 +-
 25-akpm/drivers/pci/msi.c          |    2 +-
 25-akpm/drivers/pci/msi.h          |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff -puN arch/i386/kernel/io_apic.c~ia32-msi-fixup arch/i386/kernel/io_apic.c
--- 25/arch/i386/kernel/io_apic.c~ia32-msi-fixup	Fri Apr  9 16:06:58 2004
+++ 25-akpm/arch/i386/kernel/io_apic.c	Fri Apr  9 16:06:58 2004
@@ -76,7 +76,7 @@ static struct irq_pin_list {
 	int apic, pin, next;
 } irq_2_pin[PIN_MAP_SIZE];
 
-int vector_irq[NR_IRQ_VECTORS] = { [0 ... NR_IRQ_VECTORS - 1] = -1};
+int vector_irq[NR_VECTORS] = { [0 ... NR_VECTORS - 1] = -1};
 #ifdef CONFIG_PCI_USE_VECTOR
 #define vector_to_irq(vector) 	\
 	(platform_legacy_irq(vector) ? vector : vector_irq[vector])
diff -puN drivers/pci/msi.c~ia32-msi-fixup drivers/pci/msi.c
--- 25/drivers/pci/msi.c~ia32-msi-fixup	Fri Apr  9 16:06:58 2004
+++ 25-akpm/drivers/pci/msi.c	Fri Apr  9 16:06:58 2004
@@ -33,7 +33,7 @@ static int nr_reserved_vectors = NR_HP_R
 static int nr_msix_devices = 0;
 
 #ifndef CONFIG_X86_IO_APIC
-int vector_irq[NR_IRQ_VECTORS] = { [0 ... NR_IRQ_VECTORS - 1] = -1};
+int vector_irq[NR_VECTORS] = { [0 ... NR_VECTORS - 1] = -1};
 u8 irq_vector[NR_IRQ_VECTORS] = { FIRST_DEVICE_VECTOR , 0 };
 #endif
 
diff -puN drivers/pci/msi.h~ia32-msi-fixup drivers/pci/msi.h
--- 25/drivers/pci/msi.h~ia32-msi-fixup	Fri Apr  9 16:06:58 2004
+++ 25-akpm/drivers/pci/msi.h	Fri Apr  9 16:06:58 2004
@@ -18,7 +18,7 @@
  */
 #define NR_HP_RESERVED_VECTORS 	20
 
-extern int vector_irq[NR_IRQ_VECTORS];
+extern int vector_irq[NR_VECTORS];
 extern cpumask_t pending_irq_balance_cpumask[NR_IRQS];
 extern void (*interrupt[NR_IRQS])(void);
 extern int pci_vector_resources(int last, int nr_released);

_
