# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1144  -> 1.1145 
#	include/asm-x86_64/acpi.h	1.1     -> 1.2    
#	arch/x86_64/kernel/setup.c	1.6     -> 1.7    
#	arch/x86_64/kernel/e820.c	1.4     -> 1.5    
#	arch/i386/kernel/setup.c	1.72    -> 1.73   
#	arch/i386/kernel/acpi.c	1.15    -> 1.16   
#	arch/x86_64/kernel/acpi.c	1.3     -> 1.4    
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/11/18	len.brown@intel.com	1.1145
# [ACPI ] pci=acpi ineffective fix from i386 2.6 (Thomas Schlichter)
# http://bugzilla.kernel.org/show_bug.cgi?id=1219
# --------------------------------------------
#
diff -Nru a/arch/i386/kernel/acpi.c b/arch/i386/kernel/acpi.c
--- a/arch/i386/kernel/acpi.c	Tue Nov 18 04:43:02 2003
+++ b/arch/i386/kernel/acpi.c	Tue Nov 18 04:43:02 2003
@@ -58,6 +58,7 @@
 
 #ifdef CONFIG_ACPI_BOOT
 extern int acpi_disabled;
+extern int acpi_irq;
 extern int acpi_ht;
 
 enum acpi_irq_model_id		acpi_irq_model;
@@ -415,7 +416,7 @@
 	 * If MPS is present, it will handle them,
 	 * otherwise the system will stay in PIC mode
 	 */
-	if (acpi_disabled) {
+	if (acpi_disabled || !acpi_irq) {
 		return 1;
 	}
 
diff -Nru a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
--- a/arch/i386/kernel/setup.c	Tue Nov 18 04:43:02 2003
+++ b/arch/i386/kernel/setup.c	Tue Nov 18 04:43:02 2003
@@ -183,6 +183,7 @@
 EXPORT_SYMBOL(acpi_disabled);
 
 #ifdef	CONFIG_ACPI_BOOT
+	int acpi_irq __initdata = 1; 	/* enable IRQ */
 	int acpi_ht __initdata = 1; 	/* enable HT */
 #endif
 
@@ -829,6 +830,10 @@
 			acpi_ht = 1; 
 			if (!acpi_force) acpi_disabled = 1; 
 		} 
+
+		else if (!memcmp(from, "pci=noacpi", 10)) { 
+			acpi_irq = 0; 
+		}
 
                 /* disable IO-APIC */
                 else if (!memcmp(from, "noapic", 6))
diff -Nru a/arch/x86_64/kernel/acpi.c b/arch/x86_64/kernel/acpi.c
--- a/arch/x86_64/kernel/acpi.c	Tue Nov 18 04:43:02 2003
+++ b/arch/x86_64/kernel/acpi.c	Tue Nov 18 04:43:02 2003
@@ -400,6 +400,9 @@
 {
 	int			result = 0;
 
+	if (acpi_disabled)
+		return(1);
+
 	/*
 	 * The default interrupt routing model is PIC (8259).  This gets
 	 * overriden if IOAPICs are enumerated (below).
@@ -479,6 +482,25 @@
 	 * I/O APIC 
 	 * --------
 	 */
+
+	/*
+	 * ACPI interpreter is required to complete interrupt setup,
+	 * so if it is off, don't enumerate the io-apics with ACPI.
+	 * If MPS is present, it will handle them,
+	 * otherwise the system will stay in PIC mode
+	 */
+	if (acpi_disabled || !acpi_irq) {
+		return 1;
+	}
+
+	/*
+	 * if "noapic" boot option, don't look for IO-APICs
+	 */
+	if (ioapic_setup_disabled()) {
+		printk(KERN_INFO PREFIX "Skipping IOAPIC probe "
+			"due to 'noapic' option.\n");
+		return 1;
+	}
 
 	result = acpi_table_parse_madt(ACPI_MADT_IOAPIC, acpi_parse_ioapic);
 	if (!result) { 
diff -Nru a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c
--- a/arch/x86_64/kernel/e820.c	Tue Nov 18 04:43:02 2003
+++ b/arch/x86_64/kernel/e820.c	Tue Nov 18 04:43:02 2003
@@ -501,6 +501,7 @@
 extern int fallback_aper_order;
 extern int iommu_setup(char *opt);
 extern int acpi_disabled;
+extern int acpi_irq;
 
 void __init parse_mem_cmdline (char ** cmdline_p)
 {
@@ -541,6 +542,11 @@
 #endif
  		else if (!memcmp(from, "acpi=off", 8))
   			acpi_disabled = 1;
+
+		else if (!memcmp(from, "pci=noacpi", 10)) {
+			acpi_irq = 0;
+		}
+
 		
 	next:
 		c = *(from++);
diff -Nru a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
--- a/arch/x86_64/kernel/setup.c	Tue Nov 18 04:43:02 2003
+++ b/arch/x86_64/kernel/setup.c	Tue Nov 18 04:43:02 2003
@@ -49,6 +49,10 @@
 #include <asm/proto.h>
 
 int acpi_disabled = 0;
+#ifdef	CONFIG_ACPI_BOOT
+int acpi_irq __initdata = 1	/* enable IRQ */
+#endif
+
 
 /*
  * Machine setup..
diff -Nru a/include/asm-x86_64/acpi.h b/include/asm-x86_64/acpi.h
--- a/include/asm-x86_64/acpi.h	Tue Nov 18 04:43:02 2003
+++ b/include/asm-x86_64/acpi.h	Tue Nov 18 04:43:02 2003
@@ -104,25 +104,38 @@
         :"0"(n_hi), "1"(n_lo))
 
 
-#ifndef CONFIG_ACPI_BOOT
-#define acpi_lapic 0
-#define acpi_ioapic 0
-#else
-#ifdef CONFIG_X86_LOCAL_APIC
+#ifdef CONFIG_ACPI_BOOT 
 extern int acpi_lapic;
-#else
-#define acpi_lapic 0
-#endif
-#ifdef CONFIG_X86_IO_APIC
 extern int acpi_ioapic;
-#else
-#define acpi_ioapic 0
-#endif
+
 
 /* Fixmap pages to reserve for ACPI boot-time tables (see fixmap.h) */
 #define FIX_ACPI_PAGES 4
 
-#endif /*CONFIG_ACPI_BOOT*/
+#ifdef CONFIG_X86_IO_APIC
+extern int skip_ioapic_setup;
+
+static inline void disable_ioapic_setup(void)
+{
+	skip_ioapic_setup = 1;
+}
+
+static inline int ioapic_setup_disabled(void)
+{
+	return skip_ioapic_setup;
+}
+
+#else
+static inline void disable_ioapic_setup(void)
+{ }
+
+#endif
+
+#else	/* CONFIG_ACPI_BOOT */
+#  define acpi_lapic 0
+#  define acpi_ioapic 0
+
+#endif
 
 #ifdef CONFIG_ACPI_SLEEP