[PATCH 1/2] acpi/x86: introduce __apci_map_table

Previous thread: frustrating ath9k issues in 2.6.27-rc6-00036-ga551b98 (Linus pristine tree) by Steven Noonan on Friday, September 12, 2008 - 6:37 pm. (5 messages)

Next thread: [PATCH 0/2]: Allow 8250 to work on sparc. by David Miller on Friday, September 12, 2008 - 9:18 pm. (7 messages)
From: Yinghai Lu
Date: Friday, September 12, 2008 - 6:55 pm

to prevent wrongly overwriting fixmap that still want to use.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>

---
---
 arch/ia64/kernel/acpi.c        |    4 ++++
 arch/x86/kernel/acpi/boot.c    |   22 ++++++++++++++++++++--
 arch/x86/kernel/early-quirks.c |    4 +++-
 drivers/acpi/osl.c             |    9 +++++++--
 drivers/acpi/tables.c          |   20 ++++++++++++++------
 drivers/acpi/tables/tbfadt.c   |    1 +
 drivers/acpi/tables/tbutils.c  |    7 +++++++
 drivers/acpi/tables/tbxface.c  |   20 +++++++++++++++++---
 drivers/acpi/tables/tbxfroot.c |    3 +++
 include/acpi/acpiosxf.h        |    1 +
 include/acpi/acpixf.h          |    4 ++++
 include/linux/acpi.h           |    1 +
 12 files changed, 82 insertions(+), 14 deletions(-)

Index: linux-2.6/arch/ia64/kernel/acpi.c
===================================================================
--- linux-2.6.orig/arch/ia64/kernel/acpi.c
+++ linux-2.6/arch/ia64/kernel/acpi.c
@@ -176,6 +176,10 @@ char *__init __acpi_map_table(unsigned l
 	return __va(phys_addr);
 }
 
+char *__init __acpi_unmap_table(unsigned long virt_addr, unsigned long size)
+{
+}
+
 /* --------------------------------------------------------------------------
                             Boot-time Table Parsing
    -------------------------------------------------------------------------- */
Index: linux-2.6/arch/x86/kernel/acpi/boot.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/acpi/boot.c
+++ linux-2.6/arch/x86/kernel/acpi/boot.c
@@ -119,12 +119,15 @@ enum acpi_irq_model_id acpi_irq_model =
  * from the fixed base.  That's why we start at FIX_IO_APIC_BASE_END and
  * count idx down while incrementing the phys address.
  */
+static char *prev_map __initdata;
+static unsigned long prev_size __initdata;
 char *__init __acpi_map_table(unsigned long phys, unsigned long size)
 {
-	static char *prev_map;
-	static unsigned long prev_size;
 
 	if (prev_map) {
+		printk(KERN_WARNING ...
From: Yinghai Lu
Date: Friday, September 12, 2008 - 6:55 pm

v2: use __acpi_unmap_table()

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>

---
 arch/x86/kernel/es7000_32.c      |   28 +++++++++++++++++++++++-----
 arch/x86/mach-generic/es7000.c   |   20 +++++++++++++++-----
 include/asm-x86/es7000/mpparse.h |    1 +
 3 files changed, 39 insertions(+), 10 deletions(-)

Index: linux-2.6/arch/x86/mach-generic/es7000.c
===================================================================
--- linux-2.6.orig/arch/x86/mach-generic/es7000.c
+++ linux-2.6/arch/x86/mach-generic/es7000.c
@@ -47,16 +47,26 @@ static __init int mps_oem_check(struct m
 /* Hook from generic ACPI tables.c */
 static int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
 {
-	unsigned long oem_addr;
+	unsigned long oem_addr = 0;
+	int check_dsdt;
+	int ret = 0;
+
+	/* check dsdt at first to avoid clear fix_map for oem_addr */
+	check_dsdt = es7000_check_dsdt();
+
 	if (!find_unisys_acpi_oem_table(&oem_addr)) {
-		if (es7000_check_dsdt())
-			return parse_unisys_oem((char *)oem_addr);
+		if (check_dsdt)
+			ret = parse_unisys_oem((char *)oem_addr);
 		else {
 			setup_unisys();
-			return 1;
+			ret = 1;
 		}
+		/*
+		 * we need to unmap it
+		 */
+		unmap_unisys_acpi_oem_table(oem_addr);
 	}
-	return 0;
+	return ret;
 }
 #else
 static int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
Index: linux-2.6/arch/x86/kernel/es7000_32.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/es7000_32.c
+++ linux-2.6/arch/x86/kernel/es7000_32.c
@@ -109,6 +109,7 @@ struct oem_table {
 };
 
 extern int find_unisys_acpi_oem_table(unsigned long *oem_addr);
+extern void unmap_unisys_acpi_oem_table(unsigned long oem_addr);
 #endif
 
 struct mip_reg {
@@ -243,21 +244,38 @@ parse_unisys_oem (char *oemptr)
 }
 
 #ifdef CONFIG_ACPI
-int __init
-find_unisys_acpi_oem_table(unsigned long *oem_addr)
+static unsigned long oem_addrX;
+static unsigned long oem_size;
+int __init ...
Previous thread: frustrating ath9k issues in 2.6.27-rc6-00036-ga551b98 (Linus pristine tree) by Steven Noonan on Friday, September 12, 2008 - 6:37 pm. (5 messages)

Next thread: [PATCH 0/2]: Allow 8250 to work on sparc. by David Miller on Friday, September 12, 2008 - 9:18 pm. (7 messages)