aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2018-03-08 03:00:19 -0500
committerIngo Molnar <mingo@kernel.org>2018-03-09 02:58:23 -0500
commit44612d7e0c379001460b37a29721128715bdcb02 (patch)
treee00d03528fe609d3a6a20a0b32feb9ae713f0ea9
parent5b4e4c3aa220d07d166d3f21f158bc9c69e3c044 (diff)
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: Lukas Wunner <lukas@wunner.de> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Ard 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.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--drivers/firmware/efi/apple-properties.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/firmware/efi/apple-properties.c b/drivers/firmware/efi/apple-properties.c
index b9602e0d7b50..adaa9a3714b9 100644
--- a/drivers/firmware/efi/apple-properties.c
+++ b/drivers/firmware/efi/apple-properties.c
@@ -19,6 +19,7 @@
19 19
20#include <linux/bootmem.h> 20#include <linux/bootmem.h>
21#include <linux/efi.h> 21#include <linux/efi.h>
22#include <linux/io.h>
22#include <linux/platform_data/x86/apple.h> 23#include <linux/platform_data/x86/apple.h>
23#include <linux/property.h> 24#include <linux/property.h>
24#include <linux/slab.h> 25#include <linux/slab.h>
@@ -189,7 +190,7 @@ static int __init map_properties(void)
189 190
190 pa_data = boot_params.hdr.setup_data; 191 pa_data = boot_params.hdr.setup_data;
191 while (pa_data) { 192 while (pa_data) {
192 data = ioremap(pa_data, sizeof(*data)); 193 data = memremap(pa_data, sizeof(*data), MEMREMAP_WB);
193 if (!data) { 194 if (!data) {
194 pr_err("cannot map setup_data header\n"); 195 pr_err("cannot map setup_data header\n");
195 return -ENOMEM; 196 return -ENOMEM;
@@ -197,14 +198,14 @@ static int __init map_properties(void)
197 198
198 if (data->type != SETUP_APPLE_PROPERTIES) { 199 if (data->type != SETUP_APPLE_PROPERTIES) {
199 pa_data = data->next; 200 pa_data = data->next;
200 iounmap(data); 201 memunmap(data);
201 continue; 202 continue;
202 } 203 }
203 204
204 data_len = data->len; 205 data_len = data->len;
205 iounmap(data); 206 memunmap(data);
206 207
207 data = ioremap(pa_data, sizeof(*data) + data_len); 208 data = memremap(pa_data, sizeof(*data) + data_len, MEMREMAP_WB);
208 if (!data) { 209 if (!data) {
209 pr_err("cannot map setup_data payload\n"); 210 pr_err("cannot map setup_data payload\n");
210 return -ENOMEM; 211 return -ENOMEM;
@@ -229,7 +230,7 @@ static int __init map_properties(void)
229 * to avoid breaking the chain of ->next pointers. 230 * to avoid breaking the chain of ->next pointers.
230 */ 231 */
231 data->len = 0; 232 data->len = 0;
232 iounmap(data); 233 memunmap(data);
233 free_bootmem_late(pa_data + sizeof(*data), data_len); 234 free_bootmem_late(pa_data + sizeof(*data), data_len);
234 235
235 return ret; 236 return ret;