From: Rafael J. Wysocki Date: Fri, 7 Jan 2011 00:45:58 +0000 (+0100) Subject: ACPI / PM: Make suspend_nvs_save() use acpi_os_map_memory() X-Git-Tag: firefly_0821_release~7613^2~2714^2^2~2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ca9b600be38c;p=firefly-linux-kernel-4.4.55.git ACPI / PM: Make suspend_nvs_save() use acpi_os_map_memory() It turns out that the NVS memory region that suspend_nvs_save() attempts to map has been already mapped by acpi_os_map_memory(), so suspend_nvs_save() should better use acpi_os_map_memory() for mapping memory to avoid conflicts. Signed-off-by: Rafael J. Wysocki Signed-off-by: Len Brown --- diff --git a/drivers/acpi/nvs.c b/drivers/acpi/nvs.c index 7d648092427e..54b6ab8040a6 100644 --- a/drivers/acpi/nvs.c +++ b/drivers/acpi/nvs.c @@ -12,6 +12,7 @@ #include #include #include +#include /* * Platforms, like ACPI, may want us to save some memory used by them during @@ -79,7 +80,7 @@ void suspend_nvs_free(void) free_page((unsigned long)entry->data); entry->data = NULL; if (entry->kaddr) { - iounmap(entry->kaddr); + acpi_os_unmap_memory(entry->kaddr, entry->size); entry->kaddr = NULL; } } @@ -113,7 +114,8 @@ int suspend_nvs_save(void) list_for_each_entry(entry, &nvs_list, node) if (entry->data) { - entry->kaddr = ioremap(entry->phys_start, entry->size); + entry->kaddr = acpi_os_map_memory(entry->phys_start, + entry->size); if (!entry->kaddr) { suspend_nvs_free(); return -ENOMEM;