diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-01-06 19:45:58 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-01-07 01:04:07 -0500 |
commit | ca9b600be38c73b7d25acfb8b7e4e9a9e941d881 (patch) | |
tree | 029c03cf04c3a65cfb3c8bbca0e4e6a34eaa07e4 | |
parent | d146df18c13d16e321efa8ef9b57c95c3bec1722 (diff) |
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 <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r-- | drivers/acpi/nvs.c | 6 |
1 files changed, 4 insertions, 2 deletions
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 @@ | |||
12 | #include <linux/mm.h> | 12 | #include <linux/mm.h> |
13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
14 | #include <linux/acpi.h> | 14 | #include <linux/acpi.h> |
15 | #include <acpi/acpiosxf.h> | ||
15 | 16 | ||
16 | /* | 17 | /* |
17 | * Platforms, like ACPI, may want us to save some memory used by them during | 18 | * Platforms, like ACPI, may want us to save some memory used by them during |
@@ -79,7 +80,7 @@ void suspend_nvs_free(void) | |||
79 | free_page((unsigned long)entry->data); | 80 | free_page((unsigned long)entry->data); |
80 | entry->data = NULL; | 81 | entry->data = NULL; |
81 | if (entry->kaddr) { | 82 | if (entry->kaddr) { |
82 | iounmap(entry->kaddr); | 83 | acpi_os_unmap_memory(entry->kaddr, entry->size); |
83 | entry->kaddr = NULL; | 84 | entry->kaddr = NULL; |
84 | } | 85 | } |
85 | } | 86 | } |
@@ -113,7 +114,8 @@ int suspend_nvs_save(void) | |||
113 | 114 | ||
114 | list_for_each_entry(entry, &nvs_list, node) | 115 | list_for_each_entry(entry, &nvs_list, node) |
115 | if (entry->data) { | 116 | if (entry->data) { |
116 | entry->kaddr = ioremap(entry->phys_start, entry->size); | 117 | entry->kaddr = acpi_os_map_memory(entry->phys_start, |
118 | entry->size); | ||
117 | if (!entry->kaddr) { | 119 | if (!entry->kaddr) { |
118 | suspend_nvs_free(); | 120 | suspend_nvs_free(); |
119 | return -ENOMEM; | 121 | return -ENOMEM; |