Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1480126
| From | Matt Fleming <matt@codeblueprint.co.uk> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 12/29] efi/esrt: Use memremap not ioremap to access ESRT table in memory |
| Date | 2016-09-09 17:30 +0200 |
| Message-ID | <sfvUC-4IV-41@gated-at.bofh.it> (permalink) |
| References | <sfvKV-4Fq-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
On ARM and arm64, ioremap() and memremap() are not interchangeable like
on x86, and the use of ioremap() on ordinary RAM is typically flagged
as an error if the memory region being mapped is also covered by the
linear mapping, since that would lead to aliases with conflicting
cacheability attributes.
Since what we are dealing with is not an I/O region with side effects,
using ioremap() here is arguably incorrect anyway, so let's replace
it with memremap() instead.
Acked-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
---
drivers/firmware/efi/esrt.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/firmware/efi/esrt.c b/drivers/firmware/efi/esrt.c
index b93cd11f9bcc..14914074f716 100644
--- a/drivers/firmware/efi/esrt.c
+++ b/drivers/firmware/efi/esrt.c
@@ -16,6 +16,7 @@
#include <linux/device.h>
#include <linux/efi.h>
#include <linux/init.h>
+#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/kobject.h>
#include <linux/list.h>
@@ -387,9 +388,9 @@ static int __init esrt_sysfs_init(void)
if (!esrt_data || !esrt_data_size)
return -ENOSYS;
- esrt = ioremap(esrt_data, esrt_data_size);
+ esrt = memremap(esrt_data, esrt_data_size, MEMREMAP_WB);
if (!esrt) {
- pr_err("ioremap(%pa, %zu) failed.\n", &esrt_data,
+ pr_err("memremap(%pa, %zu) failed.\n", &esrt_data,
esrt_data_size);
return -ENOMEM;
}
--
2.9.3
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[GIT PULL 00/29] EFI changes for v4.9 Matt Fleming <matt@codeblueprint.co.uk> - 2016-09-09 17:30 +0200
[PATCH 20/29] x86/efi: Map in physical addresses in efi_map_region_fixed Matt Fleming <matt@codeblueprint.co.uk> - 2016-09-09 17:30 +0200
[PATCH 27/29] x86/efi: Use kmalloc_array() in efi_call_phys_prolog() Matt Fleming <matt@codeblueprint.co.uk> - 2016-09-09 17:30 +0200
[PATCH 04/29] efi: Add efi_memmap_init_late() for permanent EFI memmap Matt Fleming <matt@codeblueprint.co.uk> - 2016-09-09 17:30 +0200
[PATCH 12/29] efi/esrt: Use memremap not ioremap to access ESRT table in memory Matt Fleming <matt@codeblueprint.co.uk> - 2016-09-09 17:30 +0200
[PATCH 25/29] efi: Add efi_test driver for exporting UEFI runtime service interfaces Matt Fleming <matt@codeblueprint.co.uk> - 2016-09-09 17:30 +0200
[PATCH 23/29] efi/arm64: Add debugfs node to dump UEFI runtime page tables Matt Fleming <matt@codeblueprint.co.uk> - 2016-09-09 17:30 +0200
[PATCH 08/29] efi: Allow drivers to reserve boot services forever Matt Fleming <matt@codeblueprint.co.uk> - 2016-09-09 17:30 +0200
[PATCH 22/29] x86/efi: Remove unused find_bits() function Matt Fleming <matt@codeblueprint.co.uk> - 2016-09-09 17:30 +0200
[PATCH 10/29] efi/esrt: Use efi_mem_reserve() and avoid a kmalloc() Matt Fleming <matt@codeblueprint.co.uk> - 2016-09-09 17:30 +0200
[PATCH 16/29] efi: Replace runtime services spinlock with semaphore Matt Fleming <matt@codeblueprint.co.uk> - 2016-09-09 17:30 +0200
[PATCH 28/29] x86/efi: Optimize away setup_gop32/64 if unused Matt Fleming <matt@codeblueprint.co.uk> - 2016-09-09 17:30 +0200
[PATCH 17/29] x86/efi: Initialize status to ensure garbage is not returned on small size Matt Fleming <matt@codeblueprint.co.uk> - 2016-09-09 17:30 +0200
[PATCH 18/29] firmware-gsmi: Delete an unnecessary check before the function call "dma_pool_destroy" Matt Fleming <matt@codeblueprint.co.uk> - 2016-09-09 17:30 +0200
[PATCH 21/29] fs/efivarfs: Fix double kfree() in error path Matt Fleming <matt@codeblueprint.co.uk> - 2016-09-09 17:30 +0200
Re: [GIT PULL 00/29] EFI changes for v4.9 Matt Fleming <matt@codeblueprint.co.uk> - 2016-09-12 13:00 +0200
Re: [GIT PULL 00/29] EFI changes for v4.9 Ingo Molnar <mingo@kernel.org> - 2016-09-12 13:50 +0200
Re: [GIT PULL 00/29] EFI changes for v4.9 Ingo Molnar <mingo@kernel.org> - 2016-09-13 20:40 +0200
csiph-web