Commit 44612d7e authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Ingo Molnar

efi/apple-properties: Use memremap() instead of ioremap()

The memory we are accessing through virtual address has no IO side
effects. Moreover, for IO memory we have to use special accessors,
which we don't use.

Due to above, convert the driver to use memremap() instead of ioremap().
Tested-by: default avatarLukas Wunner <lukas@wunner.de>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/20180308080020.22828-12-ard.biesheuvel@linaro.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 5b4e4c3a
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <linux/efi.h> #include <linux/efi.h>
#include <linux/io.h>
#include <linux/platform_data/x86/apple.h> #include <linux/platform_data/x86/apple.h>
#include <linux/property.h> #include <linux/property.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -189,7 +190,7 @@ static int __init map_properties(void) ...@@ -189,7 +190,7 @@ static int __init map_properties(void)
pa_data = boot_params.hdr.setup_data; pa_data = boot_params.hdr.setup_data;
while (pa_data) { while (pa_data) {
data = ioremap(pa_data, sizeof(*data)); data = memremap(pa_data, sizeof(*data), MEMREMAP_WB);
if (!data) { if (!data) {
pr_err("cannot map setup_data header\n"); pr_err("cannot map setup_data header\n");
return -ENOMEM; return -ENOMEM;
...@@ -197,14 +198,14 @@ static int __init map_properties(void) ...@@ -197,14 +198,14 @@ static int __init map_properties(void)
if (data->type != SETUP_APPLE_PROPERTIES) { if (data->type != SETUP_APPLE_PROPERTIES) {
pa_data = data->next; pa_data = data->next;
iounmap(data); memunmap(data);
continue; continue;
} }
data_len = data->len; data_len = data->len;
iounmap(data); memunmap(data);
data = ioremap(pa_data, sizeof(*data) + data_len); data = memremap(pa_data, sizeof(*data) + data_len, MEMREMAP_WB);
if (!data) { if (!data) {
pr_err("cannot map setup_data payload\n"); pr_err("cannot map setup_data payload\n");
return -ENOMEM; return -ENOMEM;
...@@ -229,7 +230,7 @@ static int __init map_properties(void) ...@@ -229,7 +230,7 @@ static int __init map_properties(void)
* to avoid breaking the chain of ->next pointers. * to avoid breaking the chain of ->next pointers.
*/ */
data->len = 0; data->len = 0;
iounmap(data); memunmap(data);
free_bootmem_late(pa_data + sizeof(*data), data_len); free_bootmem_late(pa_data + sizeof(*data), data_len);
return ret; return ret;
......
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