acpi: remove final __acpi_map_table mapping before setting acpi_gbl_permanent_mmap
authorJeremy Fitzhardinge <jeremy@goop.org>
Sat, 7 Feb 2009 23:39:40 +0000 (15:39 -0800)
committerIngo Molnar <mingo@elte.hu>
Mon, 9 Feb 2009 12:34:46 +0000 (13:34 +0100)
On x86, __acpi_map_table uses early_ioremap() to create the mapping,
replacing the previous mapping with a new one.  Once enough of the
kernel is up an running it switches to using normal ioremap().  At
that point, we need to clean up the final mapping to avoid a warning
from the early_ioremap subsystem.

This can be removed after all the instances in the ACPI code are fixed
that rely on early-ioremap's implicit overmapping of previously
mapped tables.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Acked-by: Len Brown <len.brown@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/acpi/boot.c
drivers/acpi/bus.c

index 5424a18f2e4efbb3d21608d1cc38f64e7f328792..7217834f6b1dbc37d0f725059086cad01f612c80 100644 (file)
@@ -124,12 +124,14 @@ char *__init __acpi_map_table(unsigned long phys, unsigned long size)
        static char *prev_map;
        static unsigned long prev_size;
 
+       if (prev_map) {
+               early_iounmap(prev_map, prev_size);
+               prev_map = NULL;
+       }
+
        if (!phys || !size)
                return NULL;
 
-       if (prev_map)
-               early_iounmap(prev_map, prev_size);
-
        prev_size = size;
        prev_map = early_ioremap(phys, size);
 
index 765fd1c56cd66bc445ab5228f562177b9eb469e1..fb1be7b5dbc1077f3bbc206803a467dbb36bb5ea 100644 (file)
@@ -694,6 +694,12 @@ void __init acpi_early_init(void)
        if (!acpi_strict)
                acpi_gbl_enable_interpreter_slack = TRUE;
 
+       /*
+        * Doing a zero-sized mapping will clear out the previous
+        * __acpi_map_table() mapping, if any.
+        */
+       __acpi_map_table(0, 0);
+
        acpi_gbl_permanent_mmap = 1;
 
        status = acpi_reallocate_root_table();