Skip to contentSkip to conversation

acpi-20030916-2.6.0-pre5.diff

PATCH In review Andrew Morton 3 participants 8 messages Sep 18, 2003 – Sep 21, 2003 6 messages not in the archive

Subsystems (4)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

PATCH 1/1 acpi-20030916-2.6.0-pre5.diff

Andrew & Co,
This patch updates 2.6.0-test5 to the current ACPI in 2.4.22-pre5 If nothing explodes, I'll be releasing it to Linus shortly via BK.

(then I'll send a patch with the upcoming linux-acpi-test-2.6.0 changes)

The thing most 2.6 users will notice is that the CONFIG_ACPI_HT_ONLY scheme has been returned to the one used in 2.4.22 that people liked better; but several key platform fixes are included too.

cheers,
-Len

It is also available here:
http://linux-acpi.bkbits.net:8080/linux-acpi-release-2.6.0

and here:
http://prdownloads.sourceforge.net/acpi/acpi-20030916-2.6.0-test5.diff?download

ChangeSet-GekAy/qdEr7X/[email protected], 2003-09-18 12:01:37-07:00, [email protected]
ACPI_CA_VERSION 0x20030916

ChangeSet-GekAy/[email protected], 2003-09-18 11:59:12-07:00, [email protected]
remove ASUS A7V BIOS version 1011 from blacklist (Eric Valette)

ChangeSet-GekAy/[email protected], 2003-09-18 11:41:51-07:00, [email protected]
IBM ThinkPAD T30/T40 oops (David Shaohua Li)
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=98849

ChangeSet-GekAy/[email protected], 2003-09-18 11:29:42-07:00, [email protected]
Extended IRQ resource type for nForce (Andrew de Quincey)

ChangeSet-GekAy/[email protected], 2003-09-18 10:58:41-07:00, [email protected]
[ACPI] Handle systems that specify non-ACPI-compliant SCI over-rides
(Jun Naka
jima)

ChangeSet-GekAy/[email protected], 2003-09-18 10:54:11-07:00, [email protected]
Handle BIOS with _CRS that fails (Jun Nakajima)

ChangeSet-GekAy/[email protected], 2003-09-18 00:52:06-04:00, [email protected]
[ACPI] merge 2.4.22 cleanup into 2.6
Restores CONFIG_ACPI_HT_ONLY as an alternative to CONFIG_ACPI
rather than a prerequisite

[email protected], 2003-09-15 00:34:00-04:00, [email protected]
sync 2.4.22 changes into 2.6
Note that this restores CONFIG_ACPI_HT_ONLY as a sub-set of
CONFIG_ACPI rather
than a dependency.

# 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.1315 -> 1.1322
# include/linux/acpi.h 1.28 -> 1.29
# drivers/acpi/pci_link.c 1.17 -> 1.19
# arch/i386/Kconfig 1.76 -> 1.77
# arch/i386/kernel/mpparse.c 1.50 -> 1.52
# arch/i386/kernel/dmi_scan.c 1.44 -> 1.46
# init/do_mounts.c 1.55 -> 1.56
# arch/i386/kernel/setup.c 1.96 -> 1.97
# drivers/acpi/ec.c 1.24 -> 1.25
# init/do_mounts.h 1.6.1.1 -> 1.8
# drivers/acpi/events/evregion.c 1.19 -> 1.20
# include/acpi/acconfig.h 1.42 -> 1.43
# arch/i386/kernel/acpi/boot.c 1.31 -> 1.32
# include/asm-i386/acpi.h 1.8 -> 1.9
# drivers/acpi/Makefile 1.35 -> 1.36
# drivers/acpi/Kconfig 1.20 -> 1.21
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/09/15 [email protected] 1.1130.1.2

# sync 2.4.22 changes into 2.6
# Note that this restores CONFIG_ACPI_HT_ONLY as a sub-set of CONFIG_ACPI rather than a dependency.
# --------------------------------------------
# 03/09/18	[email protected]	1.1316
# [ACPI] merge 2.4.22 cleanup into 2.6
# Restores CONFIG_ACPI_HT_ONLY as an alternative to CONFIG_ACPI
# rather than a prerequisite
# --------------------------------------------
# 03/09/18	[email protected]	1.1317
# Handle BIOS with _CRS that fails (Jun Nakajima)
# --------------------------------------------
# 03/09/18	[email protected]	1.1318
# [ACPI] Handle systems that specify non-ACPI-compliant SCI over-rides (Jun Nakajima)
# --------------------------------------------
# 03/09/18	[email protected]	1.1319
# Extended IRQ resource type for nForce (Andrew de Quincey)
# --------------------------------------------
# 03/09/18	[email protected]	1.1320
# IBM ThinkPAD T30/T40 oops (David Shaohua Li)
# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=98849
# --------------------------------------------
# 03/09/18	[email protected]	1.1321
# remove ASUS A7V BIOS version 1011 from blacklist (Eric Valette)
# --------------------------------------------
# 03/09/18	[email protected]	1.1322
# ACPI_CA_VERSION                 0x20030916
# --------------------------------------------
#
diff -Nru a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
--- a/arch/i386/kernel/acpi/boot.c	Thu Sep 18 14:19:28 2003
+++ b/arch/i386/kernel/acpi/boot.c	Thu Sep 18 14:19:28 2003
@@ -183,8 +183,7 @@

#endif /*CONFIG_X86_LOCAL_APIC*/

-#ifdef CONFIG_X86_IO_APIC
-
+#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER)

static int __init
acpi_parse_ioapic (
@@ -368,7 +367,6 @@

result = acpi_table_parse(ACPI_APIC, acpi_parse_madt); if (!result) {
- printk(KERN_WARNING PREFIX "MADT not present\n");
return 0;
}
else if (result < 0) {
@@ -416,7 +414,7 @@

#endif /*CONFIG_X86_LOCAL_APIC*/

-#ifdef CONFIG_X86_IO_APIC
+#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER)

/*
* I/O APIC
@@ -472,7 +470,8 @@
acpi_irq_model = ACPI_IRQ_MODEL_IOAPIC;

acpi_ioapic = 1;
-#endif /*CONFIG_X86_IO_APIC*/
+
+#endif /* CONFIG_X86_IO_APIC && CONFIG_ACPI_INTERPRETER */

#ifdef CONFIG_X86_LOCAL_APIC
if (acpi_lapic && acpi_ioapic) {
@@ -480,6 +479,7 @@
clustered_apic_check();
}
#endif
+
#ifdef CONFIG_HPET_TIMER
acpi_table_parse(ACPI_HPET, acpi_parse_hpet);
#endif

arch/i386/kernel/dmi_scan.c +4 -6
diff -Nru a/arch/i386/kernel/dmi_scan.c b/arch/i386/kernel/dmi_scan.c
@@ -939,11 +939,6 @@
 			MATCH(DMI_BOARD_NAME, "CUR-DLS"),
 			NO_MATCH, NO_MATCH }},
 
-	{ force_acpi_ht, "ASUS A7V", {
-			MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC"),
-			MATCH(DMI_BOARD_NAME, "<A7V>"),
-			MATCH(DMI_BIOS_VERSION, "ASUS A7V ACPI BIOS Revision 1011"), NO_MATCH }},
-
 	{ force_acpi_ht, "ABIT i440BX-W83977", {
 			MATCH(DMI_BOARD_VENDOR, "ABIT <http://www.abit.com>"),
 			MATCH(DMI_BOARD_NAME, "i440BX-W83977 (BP6)"),
@@ -978,7 +973,10 @@
 	{ disable_acpi_pci, "ASUS A7V", {
 			MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC"),
 			MATCH(DMI_BOARD_NAME, "<A7V>"),
-			MATCH(DMI_BIOS_VERSION, "ASUS A7V ACPI BIOS Revision 1007"), NO_MATCH }},
+			/* newer BIOS, Revision 1011, does work */
+			MATCH(DMI_BIOS_VERSION, "ASUS A7V ACPI BIOS Revision 1007"),
+			NO_MATCH }},
+
 #endif
 
 	{ NULL, }
arch/i386/kernel/mpparse.c +15 -16
diff -Nru a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c
@@ -830,7 +830,7 @@
 	MP_processor_info(&processor);
 }
 
-#ifdef CONFIG_X86_IO_APIC
+#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER)
 
 #define MP_ISA_BUS		0
 #define MP_MAX_IOAPIC_PIN	127
@@ -1019,10 +1019,6 @@
 	}
 }
 
-#ifdef	CONFIG_ACPI
-
-/* Ensure the ACPI SCI interrupt level is active low, edge-triggered */
-
 extern FADT_DESCRIPTOR acpi_fadt;
 
 void __init mp_config_ioapic_for_sci(int irq)
@@ -1031,6 +1027,7 @@
 	int ioapic_pin;
 	struct acpi_table_madt *madt;
 	struct acpi_table_int_src_ovr *entry = NULL;
+	acpi_interrupt_flags flags;
 	void *madt_end;
 	acpi_status status;
 
@@ -1054,15 +1051,12 @@
 				 * See the note at the end of ACPI 2.0b section
 				 * 5.2.10.8 for what this is about.
 				 */
-				if (entry->bus_irq != entry->global_irq) {
-					acpi_fadt.sci_int = entry->global_irq;
-					irq = entry->global_irq;
-					break;
-				}
-				else
-                			return;
+				flags = entry->flags;
+				acpi_fadt.sci_int = entry->global_irq;
+				irq = entry->global_irq;
+				break;
 			}
-
+			
                 	entry = (struct acpi_table_int_src_ovr *)
                 	        ((unsigned long) entry + entry->header.length);
         	}
@@ -1072,9 +1066,14 @@
 
 	ioapic_pin = irq - mp_ioapic_routing[ioapic].irq_start;
 
-	io_apic_set_pci_routing(ioapic, ioapic_pin, irq, 1, 1); // Active low, level triggered
+	if (flags.polarity == 0)
+		flags.polarity = 0x3;	/* Active low */ 
+	if (flags.trigger == 0) 
+		flags.trigger = 0x3;	/* Level-triggered */
+
+	io_apic_set_pci_routing(ioapic, ioapic_pin, irq, 
+				(flags.trigger >> 1) , (flags.polarity >> 1));
 }
-#endif	/* CONFIG_ACPI */
 
 #ifdef CONFIG_ACPI_PCI
 
@@ -1154,5 +1153,5 @@
 }
 
 #endif /*CONFIG_ACPI_PCI*/
-#endif	/* CONFIG_X86_IO_APIC */
+#endif /*CONFIG_X86_IO_APIC && CONFIG_ACPI_INTERPRETER*/
 #endif /*CONFIG_ACPI_BOOT*/
arch/i386/kernel/setup.c +1 -1
diff -Nru a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
@@ -64,7 +64,7 @@
 unsigned long mmu_cr4_features;
 EXPORT_SYMBOL_GPL(mmu_cr4_features);
 
-#ifdef	CONFIG_ACPI
+#ifdef	CONFIG_ACPI_INTERPRETER
 	int acpi_disabled __initdata = 0;
 #else
 	int acpi_disabled __initdata = 1;
drivers/acpi/Kconfig +60 -48

216 lines not on this page · raw message

drivers/acpi/Makefile +1 -1
diff -Nru a/drivers/acpi/Makefile b/drivers/acpi/Makefile
@@ -18,7 +18,7 @@
 # ACPI Boot-Time Table Parsing
 #
 obj-$(CONFIG_ACPI_BOOT)		+= tables.o
-obj-$(CONFIG_ACPI)		+= blacklist.o
+obj-$(CONFIG_ACPI_INTERPRETER)	+= blacklist.o
 
 #
 # ACPI Core Subsystem (Interpreter)
drivers/acpi/ec.c +5 -2
diff -Nru a/drivers/acpi/ec.c b/drivers/acpi/ec.c
@@ -32,7 +32,7 @@
 #include <asm/io.h>
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
-
+#include <acpi/actypes.h>
 
 #define _COMPONENT		ACPI_EC_COMPONENT
 ACPI_MODULE_NAME		("acpi_ec")
@@ -412,7 +412,10 @@
 	 * The EC object is in the handler context and is needed
 	 * when calling the acpi_ec_space_handler.
 	 */
-	*return_context = handler_context;
+	if(function == ACPI_REGION_DEACTIVATE) 
+		*return_context = NULL;
+	else 
+		*return_context = handler_context;
 
 	return AE_OK;
 }
drivers/acpi/events/evregion.c +3 -3
diff -Nru a/drivers/acpi/events/evregion.c b/drivers/acpi/events/evregion.c
@@ -382,7 +382,7 @@
 	union acpi_operand_object       *obj_desc;
 	union acpi_operand_object       **last_obj_ptr;
 	acpi_adr_space_setup            region_setup;
-	void                            *region_context;
+	void                            **region_context;
 	union acpi_operand_object       *region_obj2;
 	acpi_status                     status;
 
@@ -394,7 +394,7 @@
 	if (!region_obj2) {
 		return_VOID;
 	}
-	region_context = region_obj2->extra.region_context;
+	region_context = &region_obj2->extra.region_context;
 
 	/* Get the address handler from the region object */
 
@@ -450,7 +450,7 @@
 
 			region_setup = handler_obj->address_space.setup;
 			status = region_setup (region_obj, ACPI_REGION_DEACTIVATE,
-					  handler_obj->address_space.context, &region_context);
+					  handler_obj->address_space.context, region_context);
 
 			/* Init routine may fail, Just ignore errors */
 
drivers/acpi/pci_link.c +57 -17

138 lines not on this page · raw message

include/acpi/acconfig.h +1 -1
diff -Nru a/include/acpi/acconfig.h b/include/acpi/acconfig.h
@@ -64,7 +64,7 @@
 
 /* Version string */
 
-#define ACPI_CA_VERSION                 0x20030813
+#define ACPI_CA_VERSION                 0x20030916
 
 /* Maximum objects in the various object caches */
 
include/linux/acpi.h +3 -3
diff -Nru a/include/linux/acpi.h b/include/linux/acpi.h
@@ -424,17 +424,17 @@
 
 #endif /*CONFIG_ACPI_EC*/
 
-#ifdef CONFIG_ACPI
+#ifdef CONFIG_ACPI_INTERPRETER
 
 int acpi_blacklisted(void);
 
-#else
+#else /*!CONFIG_ACPI_INTERPRETER*/
 
 static inline int acpi_blacklisted(void)
 {
 	return 0;
 }
 
-#endif /*CONFIG_ACPI*/
+#endif /*!CONFIG_ACPI_INTERPRETER*/
 
 #endif /*_LINUX_ACPI_H*/
init/do_mounts.h +0 -1
diff -Nru a/init/do_mounts.h b/init/do_mounts.h
@@ -79,4 +79,3 @@
 static inline void md_run_setup(void) {}
 
 #endif
-

A message that is not in the archive (sent off-list or not yet received): 1063926206.2680.200.camel-Tk/TtsB/[email protected]

#4 lore raw
Quoted 3 lines · Len Brown

This patch updates 2.6.0-test5 to the current ACPI in 2.4.22-pre5 If nothing explodes, I'll be releasing it to Linus shortly via BK.

Well it stomps all over the below patch, which I've had for some time.

What's up?

From: Andrew de Quincey <[email protected]>

Hi, this is my next round of ACPI IRQ fixes. Attached are patches for linux-2.4.23-pre3 and linux-2.6.0-test4.

Please CC me on any replies. I seem to be having issues with vger.kernel.org right now.

This patch addresses the following issues:

1) ACPI now drops back to PIC mode if configuration in APIC mode fails.

2) Removed 2 lines of erroneous code in mpparse.c which causes IO-APICs to be misconfigured.

3) ACPI now supports PIC controllers properly.

4) This patch includes a patch by "Jun Nakajima" <[email protected]> which fixes ACPI IRQ routing for all VIA motherboards I have had tested so far. I've included it in this
patch as it changes one of the same files.

5) Now retries with an extended IRQ descriptor if programming a link device with a "standard" IRQ descriptor fails.

This has already been tested successfully by multiple people.

 25-akpm/arch/i386/kernel/acpi/Makefile   |    2 
 25-akpm/arch/i386/kernel/acpi/pic.c      |  102 ++++++++++++++
 25-akpm/arch/i386/kernel/mpparse.c       |   27 +++
 25-akpm/arch/ia64/kernel/iosapic.c       |   19 ++
 25-akpm/arch/x86_64/kernel/acpi/Makefile |    2 
 25-akpm/arch/x86_64/kernel/acpi/pic.c    |  102 ++++++++++++++
 25-akpm/arch/x86_64/kernel/mpparse.c     |   22 ++-
 25-akpm/drivers/acpi/bus.c               |    2 
 25-akpm/drivers/acpi/pci_irq.c           |  218 +++++++++++++++++++++++--------
 25-akpm/drivers/acpi/pci_link.c          |   89 +++++++++---
 25-akpm/include/acpi/acpi_bus.h          |    2 
 25-akpm/include/acpi/acpi_drivers.h      |    8 -
 25-akpm/include/asm-i386/acpi.h          |    3 
 25-akpm/include/asm-i386/mpspec.h        |    2 
 25-akpm/include/asm-ia64/acpi.h          |    3 
 25-akpm/include/asm-ia64/iosapic.h       |    2 
 25-akpm/include/asm-x86_64/acpi.h        |    3 
 25-akpm/include/asm-x86_64/mpspec.h      |    2 
 25-akpm/include/linux/acpi.h             |    2 
 19 files changed, 522 insertions(+), 90 deletions(-)
arch/i386/kernel/acpi/Makefile renamed from arch/i386/kernel/acpi/Makefile~acpi-irq-fixes +1 -1
diff -puN arch/i386/kernel/acpi/Makefile~acpi-irq-fixes arch/i386/kernel/acpi/Makefile
@@ -1,3 +1,3 @@
-obj-$(CONFIG_ACPI_BOOT)		:= boot.o
+obj-$(CONFIG_ACPI_BOOT)		:= boot.o pic.o
 obj-$(CONFIG_ACPI_SLEEP)	+= sleep.o wakeup.o
 
arch/i386/kernel/acpi/pic.c new file +102 -0

102 lines not on this page · raw message

arch/i386/kernel/mpparse.c renamed from arch/i386/kernel/mpparse.c~acpi-irq-fixes +23 -4
diff -puN arch/i386/kernel/mpparse.c~acpi-irq-fixes arch/i386/kernel/mpparse.c
@@ -1078,10 +1078,11 @@ void __init mp_config_ioapic_for_sci(int
 
 #ifdef CONFIG_ACPI_PCI
 
-void __init mp_parse_prt (void)
+int __init mp_parse_prt (void)
 {
 	struct list_head	*node = NULL;
 	struct acpi_prt_entry	*entry = NULL;
+ 	struct acpi_prt_list	*prt_list = NULL;
 	int			ioapic = -1;
 	int			ioapic_pin = 0;
 	int			irq = 0;
@@ -1089,16 +1090,31 @@ void __init mp_parse_prt (void)
 	int			edge_level = 0;
 	int			active_high_low = 0;
 
+ 	/* Get the current PRT */
+ 	prt_list = acpi_pci_get_prt_list();
+
+ 	if (!prt_list->count) {
+ 		acpi_pci_destroy_prt_list(prt_list);
+ 		printk(KERN_WARNING PREFIX "ACPI tables contain no IO-APIC PCI IRQ "
+ 			"routing entries\n");
+ 		return_VALUE(-ENODEV);
+ 	}
+
 	/*
 	 * Parsing through the PCI Interrupt Routing Table (PRT) and program
 	 * routing for all entries.
 	 */
-	list_for_each(node, &acpi_prt.entries) {
+	list_for_each(node, &prt_list->entries) {
 		entry = list_entry(node, struct acpi_prt_entry, node);
 
 		/* Need to get irq for dynamic entry */
 		if (entry->link.handle) {
 			irq = acpi_pci_link_get_irq(entry->link.handle, entry->link.index, &edge_level, &active_high_low);
+			if (irq < 0) {
+				acpi_pci_destroy_prt_list(prt_list);
+				return -ENODEV;
+			}
+
 			if (!irq)
 				continue;
 		}
@@ -1118,8 +1134,6 @@ void __init mp_parse_prt (void)
 			continue;
 		ioapic_pin = irq - mp_ioapic_routing[ioapic].irq_start;
 
-		if (!ioapic && (irq < 16))
-			irq += 16;
 		/* 
 		 * Avoid pin reprogramming.  PRTs typically include entries  
 		 * with redundant pin->irq mappings (but unique PCI devices);
@@ -1151,6 +1165,11 @@ void __init mp_parse_prt (void)
 			mp_ioapic_routing[ioapic].apic_id, ioapic_pin, 
 			entry->irq);
 	}
+
+ 	/* if we get here, the PRT was fine. commit it */
+ 	acpi_pci_commit_prt_list(prt_list);
+
+	return 0;
 }
 
 #endif /*CONFIG_ACPI_PCI*/
arch/ia64/kernel/iosapic.c renamed from arch/ia64/kernel/iosapic.c~acpi-irq-fixes +17 -2
diff -puN arch/ia64/kernel/iosapic.c~acpi-irq-fixes arch/ia64/kernel/iosapic.c
@@ -680,7 +680,7 @@ iosapic_enable_intr (unsigned int vector
 
 #ifdef CONFIG_ACPI_PCI
 
-void __init
+int __init
 iosapic_parse_prt (void)
 {
 	struct acpi_prt_entry *entry;
@@ -690,8 +690,19 @@ iosapic_parse_prt (void)
 	char pci_id[16];
 	struct hw_interrupt_type *irq_type = &irq_type_iosapic_level;
 	irq_desc_t *idesc;
+ 	struct acpi_prt_list	*prt_list = NULL;
 
-	list_for_each(node, &acpi_prt.entries) {
+ 	/* Get the current PRT */
+ 	prt_list = acpi_pci_get_prt_list();
+
+ 	if (!prt_list->count) {
+ 		acpi_pci_destroy_prt_list(prt_list);
+ 		printk(KERN_WARNING PREFIX "ACPI tables contain no IO-APIC PCI IRQ "
+ 			"routing entries\n");
+ 		return_VALUE(-ENODEV);
+ 	}
+
+	list_for_each(node, &prt_list->entries) {
 		entry = list_entry(node, struct acpi_prt_entry, node);
 
 		/* We're only interested in static (non-link) entries.  */
@@ -729,6 +740,10 @@ iosapic_parse_prt (void)
 				      IOSAPIC_LEVEL);
 
 	}
+
+ 	/* if we get here, the PRT was fine. commit it */
+ 	acpi_pci_commit_prt_list(prt_list);
+	return 0;
 }
 
 #endif /* CONFIG_ACPI */
arch/x86_64/kernel/acpi/Makefile renamed from arch/x86_64/kernel/acpi/Makefile~acpi-irq-fixes +1 -1
diff -puN arch/x86_64/kernel/acpi/Makefile~acpi-irq-fixes arch/x86_64/kernel/acpi/Makefile
@@ -1,3 +1,3 @@
-obj-$(CONFIG_ACPI_BOOT)		:= boot.o
+obj-$(CONFIG_ACPI_BOOT)		:= boot.o pic.o
 obj-$(CONFIG_ACPI_SLEEP)	+= sleep.o wakeup.o
 
arch/x86_64/kernel/acpi/pic.c new file +102 -0

102 lines not on this page · raw message

arch/x86_64/kernel/mpparse.c renamed from arch/x86_64/kernel/mpparse.c~acpi-irq-fixes +20 -2
diff -puN arch/x86_64/kernel/mpparse.c~acpi-irq-fixes arch/x86_64/kernel/mpparse.c
@@ -889,16 +889,31 @@ void __init mp_parse_prt (void)
 	int			edge_level = 0;
 	int			active_high_low = 0;
 
+ 	/* Get the current PRT */
+ 	prt_list = acpi_pci_get_prt_list();
+
+ 	if (!prt_list->count) {
+ 		acpi_pci_destroy_prt_list(prt_list);
+ 		printk(KERN_WARNING PREFIX "ACPI tables contain no IO-APIC PCI IRQ "
+ 			"routing entries\n");
+ 		return_VALUE(-ENODEV);
+ 	}
+
 	/*
 	 * Parsing through the PCI Interrupt Routing Table (PRT) and program
 	 * routing for all static (IOAPIC-direct) entries.
 	 */
-	list_for_each(node, &acpi_prt.entries) {
+	list_for_each(node, &acpi_prt->entries) {
 		entry = list_entry(node, struct acpi_prt_entry, node);
 
 		/* Need to get irq for dynamic entry */
 		if (entry->link.handle) {
 			irq = acpi_pci_link_get_irq(entry->link.handle, entry->link.index, &edge_level, &active_high_low);
+			if (irq < 0) {
+				acpi_pci_destroy_prt_list(prt_list);
+				return -ENODEV;
+			}
+
 			if (!irq)
 				continue;
 		} else {
@@ -949,8 +964,11 @@ void __init mp_parse_prt (void)
 			mp_ioapic_routing[ioapic].apic_id, ioapic_pin, vector, 
 			entry->irq);
 	}
+
+ 	/* if we get here, the PRT was fine. commit it */
+ 	acpi_pci_commit_prt_list(prt_list);
 	
-	return;
+	return 0;
 }
 
 #endif /*CONFIG_ACPI_PCI*/
drivers/acpi/bus.c renamed from drivers/acpi/bus.c~acpi-irq-fixes +1 -1
diff -puN drivers/acpi/bus.c~acpi-irq-fixes drivers/acpi/bus.c
@@ -536,7 +536,7 @@ acpi_bus_notify (
                              Initialization/Cleanup
    -------------------------------------------------------------------------- */
 
-static int __init
+int
 acpi_bus_init_irq (void)
 {
 	acpi_status		status = AE_OK;
drivers/acpi/pci_irq.c renamed from drivers/acpi/pci_irq.c~acpi-irq-fixes +164 -54

298 lines not on this page · raw message

drivers/acpi/pci_link.c renamed from drivers/acpi/pci_link.c~acpi-irq-fixes +69 -20

175 lines not on this page · raw message

include/acpi/acpi_bus.h renamed from include/acpi/acpi_bus.h~acpi-irq-fixes +2 -0
diff -puN include/acpi/acpi_bus.h~acpi-irq-fixes include/acpi/acpi_bus.h
@@ -307,6 +307,8 @@ int acpi_bus_unregister_driver (struct a
 int acpi_create_dir(struct acpi_device *);
 void acpi_remove_dir(struct acpi_device *);
 
+int acpi_bus_init_irq (void);
+
 #endif /*CONFIG_ACPI_BUS*/
 
 #endif /*__ACPI_BUS_H__*/
include/acpi/acpi_drivers.h renamed from include/acpi/acpi_drivers.h~acpi-irq-fixes +7 -1
diff -puN include/acpi/acpi_drivers.h~acpi-irq-fixes include/acpi/acpi_drivers.h
@@ -26,6 +26,9 @@
 #ifndef __ACPI_DRIVERS_H__
 #define __ACPI_DRIVERS_H__
 
+/* forward definitions */
+struct acpi_prt_list;
+
 #include <linux/acpi.h>
 #include <acpi/acpi_bus.h>
 
@@ -59,12 +62,15 @@ void acpi_pci_get_translations (struct a
 
 /* ACPI PCI Interrupt Link (pci_link.c) */
 
-int acpi_pci_link_check (void);
+int acpi_pci_link_calc_penalties (void);
 int acpi_pci_link_get_irq (acpi_handle handle, int index, int* edge_level, int* active_high_low);
 
 /* ACPI PCI Interrupt Routing (pci_irq.c) */
 
 int acpi_pci_irq_add_prt (acpi_handle handle, int segment, int bus);
+int acpi_pci_commit_prt_list (struct acpi_prt_list* prt_list);
+int acpi_pci_destroy_prt_list (struct acpi_prt_list* prt_list);
+struct acpi_prt_list* acpi_pci_get_prt_list (void);
 
 /* ACPI PCI Device Binding (pci_bind.c) */
 
include/asm-i386/acpi.h renamed from include/asm-i386/acpi.h~acpi-irq-fixes +3 -0
diff -puN include/asm-i386/acpi.h~acpi-irq-fixes include/asm-i386/acpi.h
@@ -151,6 +151,9 @@ extern unsigned long acpi_wakeup_address
 /* early initialization routine */
 extern void acpi_reserve_bootmem(void);
 
+/* ACPI-based PIC initialisation */
+extern int pic_parse_prt (void);
+
 #endif /*CONFIG_ACPI_SLEEP*/
 
 #endif /*__KERNEL__*/
include/asm-i386/mpspec.h renamed from include/asm-i386/mpspec.h~acpi-irq-fixes +1 -1
diff -puN include/asm-i386/mpspec.h~acpi-irq-fixes include/asm-i386/mpspec.h
@@ -37,7 +37,7 @@ extern void mp_register_lapic_address (u
 extern void mp_register_ioapic (u8 id, u32 address, u32 irq_base);
 extern void mp_override_legacy_irq (u8 bus_irq, u8 polarity, u8 trigger, u32 global_irq);
 extern void mp_config_acpi_legacy_irqs (void);
-extern void mp_parse_prt (void);
+extern int mp_parse_prt (void);
 
 #ifdef CONFIG_X86_IO_APIC
 extern void mp_config_ioapic_for_sci(int irq);
include/asm-ia64/acpi.h renamed from include/asm-ia64/acpi.h~acpi-irq-fixes +3 -0
diff -puN include/asm-ia64/acpi.h~acpi-irq-fixes include/asm-ia64/acpi.h
@@ -100,6 +100,9 @@ extern int __initdata pxm_to_nid_map[MAX
 extern int __initdata nid_to_pxm_map[NR_NODES];
 #endif
 
+/* ia64 machines don't have PIC controllers */
+static inline int pic_parse_prt(void) { return -1; }
+
 #endif /*__KERNEL__*/
 
 #endif /*_ASM_ACPI_H*/
include/asm-ia64/iosapic.h renamed from include/asm-ia64/iosapic.h~acpi-irq-fixes +1 -1
diff -puN include/asm-ia64/iosapic.h~acpi-irq-fixes include/asm-ia64/iosapic.h
@@ -57,7 +57,7 @@ extern void __init iosapic_init (unsigne
 				    unsigned int gsi_base);
 extern int gsi_to_vector (unsigned int gsi);
 extern int gsi_to_irq (unsigned int gsi);
-extern void __init iosapic_parse_prt (void);
+extern int __init iosapic_parse_prt (void);
 extern void iosapic_enable_intr (unsigned int vector);
 extern int iosapic_register_intr (unsigned int gsi, unsigned long polarity,
 				  unsigned long trigger);
include/asm-x86_64/acpi.h renamed from include/asm-x86_64/acpi.h~acpi-irq-fixes +3 -0
diff -puN include/asm-x86_64/acpi.h~acpi-irq-fixes include/asm-x86_64/acpi.h
@@ -146,6 +146,9 @@ extern int acpi_disabled;
 #define BROKEN_ACPI_Sx		0x0001
 #define BROKEN_INIT_AFTER_S1	0x0002
 
+/* ACPI-based PIC initialisation */
+extern int pic_parse_prt (void);
+
 #endif /*__KERNEL__*/
 
 #endif /*_ASM_ACPI_H*/
include/asm-x86_64/mpspec.h renamed from include/asm-x86_64/mpspec.h~acpi-irq-fixes +1 -1
diff -puN include/asm-x86_64/mpspec.h~acpi-irq-fixes include/asm-x86_64/mpspec.h
@@ -189,7 +189,7 @@ extern void mp_register_lapic_address (u
 extern void mp_register_ioapic (u8 id, u32 address, u32 irq_base);
 extern void mp_override_legacy_irq (u8 bus_irq, u8 polarity, u8 trigger, u32 global_irq);
 extern void mp_config_acpi_legacy_irqs (void);
-extern void mp_parse_prt (void);
+extern int mp_parse_prt (void);
 #endif /*CONFIG_X86_IO_APIC*/
 #endif
 
include/linux/acpi.h renamed from include/linux/acpi.h~acpi-irq-fixes +1 -1
diff -puN include/linux/acpi.h~acpi-irq-fixes include/linux/acpi.h
@@ -399,7 +399,7 @@ struct acpi_prt_list {
 	struct list_head	entries;
 };
 
-extern struct acpi_prt_list	acpi_prt;
+extern struct acpi_prt_list*	acpi_prt;
 
 struct pci_dev;
 

_

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#5 lore raw
In reply to a message not in the archive
Quoted 3 lines · Len Brown

This patch updates 2.6.0-test5 to the current ACPI in 2.4.22-pre5 If nothing explodes, I'll be releasing it to Linus shortly via BK.

And it doesn't include this fix

From: Andi Kleen <[email protected]>

Try this (untested) patch

(2.6 version untested, I tested a similar patch on the 2.4 backport of ACPI):

 25-akpm/arch/i386/pci/acpi.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)
arch/i386/pci/acpi.c renamed from arch/i386/pci/acpi.c~acpi_off-fix +2 -1
diff -puN arch/i386/pci/acpi.c~acpi_off-fix arch/i386/pci/acpi.c
@@ -15,10 +15,11 @@ struct pci_bus * __devinit pci_acpi_scan
 
 static int __init pci_acpi_init(void)
 {
+	extern int acpi_disabled;
 	if (pcibios_scanned)
 		return 0;
 
-	if (!(pci_probe & PCI_NO_ACPI_ROUTING)) {
+	if (!(pci_probe & PCI_NO_ACPI_ROUTING) && !acpi_disabled) {
 		if (!acpi_pci_irq_init()) {
 			printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n");
 			printk(KERN_INFO "PCI: if you experience problems, try using option 'pci=noacpi' or even 'acpi=off'\n");

_

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#6 lore raw
In reply to a message not in the archive
Quoted 3 lines · Len Brown

This patch updates 2.6.0-test5 to the current ACPI in 2.4.22-pre5 If nothing explodes, I'll be releasing it to Linus shortly via BK.

And it doesn't include this fix.

From: Andrew de Quincey <[email protected]>

With the help of Chris Wright testing several failed patches, I've tracked down another ACPI IRQ problem. On many systems, the BIOS pre-allocates IRQs for certain PCI devices, providing a list of alternate possibilities as well.

On some systems, changing the IRQ to one of those alternate possibilities works fine. On others however, it really isn't a good idea. As theres no way to tell which systems are good and bad in advance, this patch simply ensures that ACPI does not change an IRQ if the BIOS has pre-allocated it.

 25-akpm/drivers/acpi/pci_link.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)
drivers/acpi/pci_link.c renamed from drivers/acpi/pci_link.c~acpi-bios-preallocation-fix +8 -9
diff -puN drivers/acpi/pci_link.c~acpi-bios-preallocation-fix drivers/acpi/pci_link.c
@@ -509,15 +509,14 @@ static int acpi_pci_link_allocate(struct
 		irq = link->irq.active;
 	} else {
 		irq = link->irq.possible[0];
-	}
-
-	/*
-	 * Select the best IRQ.  This is done in reverse to promote
-	 * the use of IRQs 9, 10, 11, and >15.
-	 */
-	for (i=(link->irq.possible_count-1); i>0; i--) {
-		if (acpi_irq_penalty[irq] > acpi_irq_penalty[link->irq.possible[i]])
-			irq = link->irq.possible[i];
+		/*
+		 * Select the best IRQ.  This is done in reverse to promote
+		 * the use of IRQs 9, 10, 11, and >15.
+		 */
+		for (i=(link->irq.possible_count-1); i>0; i--) {
+			if (acpi_irq_penalty[irq] > acpi_irq_penalty[link->irq.possible[i]])
+				irq = link->irq.possible[i];
+		}
 	}
 
 	/* Attempt to enable the link device at this IRQ. */

_

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw
Quoted 6 lines · Andrew Morton
Quoted 3 lines · Len Brown

This patch updates 2.6.0-test5 to the current ACPI in 2.4.22-pre5 If nothing explodes, I'll be releasing it to Linus shortly via BK.

And it doesn't include this fix.

This fix is also missing.

-Andi

-----------------------------------------------------------------

ACPI modules check acpi_disabled at module load time. This fixes random failures to load battery.o et.al.

arch/i386/kernel/setup.c renamed from arch/i386/kernel/setup.c-ACPIINIT +2 -2
diff -u linux-2.6.0test5-work/arch/i386/kernel/setup.c-ACPIINIT linux-2.6.0test5-work/arch/i386/kernel/setup.c
@@ -64,9 +64,9 @@
 EXPORT_SYMBOL_GPL(mmu_cr4_features);
 
 #ifdef	CONFIG_ACPI
-	int acpi_disabled __initdata = 0;
+	int acpi_disabled = 0;
 #else
-	int acpi_disabled __initdata = 1;
+	int acpi_disabled = 1;
 #endif
 EXPORT_SYMBOL(acpi_disabled);
 
arch/ia64/kernel/acpi.c renamed from arch/ia64/kernel/acpi.c-ACPIINIT +1 -1
diff -u linux-2.6.0test5-work/arch/ia64/kernel/acpi.c-ACPIINIT linux-2.6.0test5-work/arch/ia64/kernel/acpi.c
@@ -56,7 +56,7 @@
 
 unsigned char acpi_kbd_controller_present = 1;
 
-int acpi_disabled __initdata;	/* XXX this shouldn't be needed---we can't boot without ACPI! */
+int acpi_disabled;	/* XXX this shouldn't be needed---we can't boot without ACPI! */
 
 const char *
 acpi_get_sysname (void)
arch/x86_64/kernel/setup.c renamed from arch/x86_64/kernel/setup.c-ACPIINIT +1 -1
diff -u linux-2.6.0test5-work/arch/x86_64/kernel/setup.c-ACPIINIT linux-2.6.0test5-work/arch/x86_64/kernel/setup.c
@@ -64,7 +64,7 @@
 unsigned long mmu_cr4_features;
 EXPORT_SYMBOL_GPL(mmu_cr4_features);
 
-int acpi_disabled __initdata = 0;
+int acpi_disabled = 0;
 
 /* For PCI or other memory-mapped resources */
 unsigned long pci_mem_start = 0x10000000;

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

A message that is not in the archive (sent off-list or not yet received): [email protected]

#10 lore raw

Andi,
Good hunting!

This fix has been integrated with others in the ACPI patch, and is available now in these bitkeeper trees:

http://linux-acpi.bkbits.net/linux-acpi-test-2.4.22
http://linux-acpi.bkbits.net/linux-acpi-test-2.4.23
http://linux-acpi.bkbits.net/linux-acpi-test-2.6.0

thanks,
-Len

Quoted 50 lines · Andi Kleen
Quoted 6 lines · Andrew Morton
Quoted 3 lines · Len Brown

This patch updates 2.6.0-test5 to the current ACPI in 2.4.22-pre5 If nothing explodes, I'll be releasing it to Linus shortly via BK.

And it doesn't include this fix.

This fix is also missing.

-Andi

-----------------------------------------------------------------

ACPI modules check acpi_disabled at module load time. This fixes random failures to load battery.o et.al.

diff -u linux-2.6.0test5-work/arch/i386/kernel/setup.c-ACPIINIT linux-2.6.0test5-work/arch/i386/kernel/setup.c

arch/i386/kernel/setup.c renamed from arch/i386/kernel/setup.c-ACPIINIT +2 -2
@@ -64,9 +64,9 @@
 EXPORT_SYMBOL_GPL(mmu_cr4_features);
 
 #ifdef	CONFIG_ACPI
-	int acpi_disabled __initdata = 0;
+	int acpi_disabled = 0;
 #else
-	int acpi_disabled __initdata = 1;
+	int acpi_disabled = 1;
 #endif
 EXPORT_SYMBOL(acpi_disabled);
 

diff -u linux-2.6.0test5-work/arch/ia64/kernel/acpi.c-ACPIINIT linux-2.6.0test5-work/arch/ia64/kernel/acpi.c

arch/ia64/kernel/acpi.c renamed from arch/ia64/kernel/acpi.c-ACPIINIT +1 -1
@@ -56,7 +56,7 @@
 
 unsigned char acpi_kbd_controller_present = 1;
 
-int acpi_disabled __initdata;	/* XXX this shouldn't be needed---we can't boot without ACPI! */
+int acpi_disabled;	/* XXX this shouldn't be needed---we can't boot without ACPI! */
 
 const char *
 acpi_get_sysname (void)

diff -u linux-2.6.0test5-work/arch/x86_64/kernel/setup.c-ACPIINIT linux-2.6.0test5-work/arch/x86_64/kernel/setup.c

arch/x86_64/kernel/setup.c line 70

Quoted 8 lines
arch/x86_64/kernel/setup.c renamed from arch/x86_64/kernel/setup.c-ACPIINIT +1 -1
@@ -64,7 +64,7 @@
 unsigned long mmu_cr4_features;
 EXPORT_SYMBOL_GPL(mmu_cr4_features);
 
-int acpi_disabled __initdata = 0;
+int acpi_disabled = 0;
 
 /* For PCI or other memory-mapped resources */
 unsigned long pci_mem_start = 0x10000000;

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

A message that is not in the archive (sent off-list or not yet received): 1063942898.2676.391.camel-Tk/TtsB/[email protected]

#12 lore raw
Quoted 9 lines · Len

Andi,
Good hunting!

This fix has been integrated with others in the ACPI patch, and is available now in these bitkeeper trees:

http://linux-acpi.bkbits.net/linux-acpi-test-2.4.22
http://linux-acpi.bkbits.net/linux-acpi-test-2.4.23
http://linux-acpi.bkbits.net/linux-acpi-test-2.6.0

I think you could at least push this one directly to Andrew/Linus without testing it in a separate tree first. It is an quite obvious fix with no risk to break anything.

-Andi

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#13 lore raw
In reply to a message not in the archive
Quoted 9 lines · Len

Andi,
Good hunting!

This fix has been integrated with others in the ACPI patch, and is available now in these bitkeeper trees:

http://linux-acpi.bkbits.net/linux-acpi-test-2.4.22
http://linux-acpi.bkbits.net/linux-acpi-test-2.4.23
http://linux-acpi.bkbits.net/linux-acpi-test-2.6.0

I forgot to fix IA64 in the original patch. Please check that it is fixed in arch/ia64/kernel/acpi.c too.

-Andi

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf