Re: [PATCH 1/1] EFI iounpam fix for acpi_os_unmap_memory

Andrew Morton
2006-02-21T06:04:06Z

Edgar Hucek <hostmaster@ed-soft.at> wrote:
>
> When EFI is enabled acpi_os_unmap_memory trys to unmap memory
> which was not mapped by acpi_os_map_memory.

Your email client replaces tabs with spaces and wordwraps things.

The patch could be cleaned up a bit..

Matt, ACPi people: please ack or nack asap.

From: Edgar Hucek <hostmaster@ed-soft.at>

When EFI is enabled acpi_os_unmap_memory t] rys to unmap memory
which was not mapped by acpi_os_map_memory.

Signed-off-by: Edgar Hucek <hostmaster@ed-soft.at>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

drivers/acpi/osl.c | 4 ++++
1 files changed, 4 insertions(+)

diff -puN drivers/acpi/osl.c~efi-iounpam-fix-for-acpi_os_unmap_memory drivers/acpi/osl.c
--- devel/drivers/acpi/osl.c~efi-iounpam-fix-for-acpi_os_unmap_memory 2006-02-20 21:55:48.000000000 -0800
+++ devel-akpm/drivers/acpi/osl.c 2006-02-20 21:58:36.000000000 -0800
@@ -208,6 +208,10 @@ EXPORT_SYMBOL_GPL(acpi_os_map_memory);

void acpi_os_unmap_memory(void __iomem * virt, acpi_size size)
{
+ /* Don't unmap memory which was not mapped by acpi_os_map_memory */
+ if (efi_enabled &&
+ (efi_mem_attributes(virt_to_phys(virt)) & EFI_MEMORY_WB))
+ return;
iounmap(virt);
}
EXPORT_SYMBOL_GPL(acpi_os_unmap_memory);
_