Commit ca9b600b authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Len Brown

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: default avatarRafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent d146df18
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/acpi.h> #include <linux/acpi.h>
#include <acpi/acpiosxf.h>
/* /*
* Platforms, like ACPI, may want us to save some memory used by them during * Platforms, like ACPI, may want us to save some memory used by them during
...@@ -79,7 +80,7 @@ void suspend_nvs_free(void) ...@@ -79,7 +80,7 @@ void suspend_nvs_free(void)
free_page((unsigned long)entry->data); free_page((unsigned long)entry->data);
entry->data = NULL; entry->data = NULL;
if (entry->kaddr) { if (entry->kaddr) {
iounmap(entry->kaddr); acpi_os_unmap_memory(entry->kaddr, entry->size);
entry->kaddr = NULL; entry->kaddr = NULL;
} }
} }
...@@ -113,7 +114,8 @@ int suspend_nvs_save(void) ...@@ -113,7 +114,8 @@ int suspend_nvs_save(void)
list_for_each_entry(entry, &nvs_list, node) list_for_each_entry(entry, &nvs_list, node)
if (entry->data) { 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) { if (!entry->kaddr) {
suspend_nvs_free(); suspend_nvs_free();
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment