diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2009-02-07 18:39:41 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-09 07:35:07 -0500 |
commit | 7d97277b754d3ee098a5ec69b6aaafb00c94e2f2 (patch) | |
tree | 457ff6256a2da2f39f93500453a6a643ab29ef2b /arch/x86/kernel/acpi/boot.c | |
parent | 05876f88ed9a66b26af613e222795ae790616252 (diff) |
acpi/x86: introduce __apci_map_table, v4
to prevent wrongly overwriting fixmap that still want to use.
ACPI used to rely on low mappings being all linearly mapped and
grew a habit: it never really unmapped certain kinds of tables
after use.
This can cause problems - for example the hypothetical case
when some spurious access still references it.
v2: remove prev_map and prev_size in __apci_map_table
v3: let acpi_os_unmap_memory() call early_iounmap too, so remove extral calling to
early_acpi_os_unmap_memory
v4: fix typo in one acpi_get_table_with_size calling
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Acked-by: Len Brown <len.brown@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/acpi/boot.c')
-rw-r--r-- | arch/x86/kernel/acpi/boot.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 7217834f6b1d..4c2aaea42930 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
@@ -121,21 +121,18 @@ enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_PIC; | |||
121 | */ | 121 | */ |
122 | char *__init __acpi_map_table(unsigned long phys, unsigned long size) | 122 | char *__init __acpi_map_table(unsigned long phys, unsigned long size) |
123 | { | 123 | { |
124 | static char *prev_map; | ||
125 | static unsigned long prev_size; | ||
126 | |||
127 | if (prev_map) { | ||
128 | early_iounmap(prev_map, prev_size); | ||
129 | prev_map = NULL; | ||
130 | } | ||
131 | 124 | ||
132 | if (!phys || !size) | 125 | if (!phys || !size) |
133 | return NULL; | 126 | return NULL; |
134 | 127 | ||
135 | prev_size = size; | 128 | return early_ioremap(phys, size); |
136 | prev_map = early_ioremap(phys, size); | 129 | } |
130 | void __init __acpi_unmap_table(char *map, unsigned long size) | ||
131 | { | ||
132 | if (!map || !size) | ||
133 | return; | ||
137 | 134 | ||
138 | return prev_map; | 135 | early_iounmap(map, size); |
139 | } | 136 | } |
140 | 137 | ||
141 | #ifdef CONFIG_PCI_MMCONFIG | 138 | #ifdef CONFIG_PCI_MMCONFIG |