diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-13 10:00:51 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-13 10:02:35 -0500 |
commit | 716a3dc20084da9b3ab17bd125005a5345e23e3b (patch) | |
tree | f7ba487050d33fc2913fdee81b384f5578ccb105 /arch/arm/mach-imx/mach-mx31_3ds.c | |
parent | 4de3a8e101150feaefa1139611a50ff37467f33e (diff) |
ARM: Add arm_memblock_steal() to allocate memory away from the kernel
Several platforms are now using the memblock_alloc+memblock_free+
memblock_remove trick to obtain memory which won't be mapped in the
kernel's page tables. Most platforms do this (correctly) in the
->reserve callback. However, OMAP has started to call these functions
outside of this callback, and this is extremely unsafe - memory will
not be unmapped, and could well be given out after memblock is no
longer responsible for its management.
So, provide arm_memblock_steal() to perform this function, and ensure
that it panic()s if it is used inappropriately. Convert everyone
over, including OMAP.
As a result, OMAP with OMAP4_ERRATA_I688 enabled will panic on boot
with this change. Mark this option as BROKEN and make it depend on
BROKEN. OMAP needs to be fixed, or 137d105d50 (ARM: OMAP4: Fix
errata i688 with MPU interconnect barriers.) reverted until such
time it can be fixed correctly.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-imx/mach-mx31_3ds.c')
-rw-r--r-- | arch/arm/mach-imx/mach-mx31_3ds.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/arm/mach-imx/mach-mx31_3ds.c b/arch/arm/mach-imx/mach-mx31_3ds.c index 89c33258639f..4d1aab154400 100644 --- a/arch/arm/mach-imx/mach-mx31_3ds.c +++ b/arch/arm/mach-imx/mach-mx31_3ds.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <asm/mach/time.h> | 36 | #include <asm/mach/time.h> |
37 | #include <asm/memory.h> | 37 | #include <asm/memory.h> |
38 | #include <asm/mach/map.h> | 38 | #include <asm/mach/map.h> |
39 | #include <asm/memblock.h> | ||
39 | #include <mach/common.h> | 40 | #include <mach/common.h> |
40 | #include <mach/iomux-mx3.h> | 41 | #include <mach/iomux-mx3.h> |
41 | #include <mach/3ds_debugboard.h> | 42 | #include <mach/3ds_debugboard.h> |
@@ -754,10 +755,8 @@ static struct sys_timer mx31_3ds_timer = { | |||
754 | static void __init mx31_3ds_reserve(void) | 755 | static void __init mx31_3ds_reserve(void) |
755 | { | 756 | { |
756 | /* reserve MX31_3DS_CAMERA_BUF_SIZE bytes for mx3-camera */ | 757 | /* reserve MX31_3DS_CAMERA_BUF_SIZE bytes for mx3-camera */ |
757 | mx3_camera_base = memblock_alloc(MX31_3DS_CAMERA_BUF_SIZE, | 758 | mx3_camera_base = arm_memblock_steal(MX31_3DS_CAMERA_BUF_SIZE, |
758 | MX31_3DS_CAMERA_BUF_SIZE); | 759 | MX31_3DS_CAMERA_BUF_SIZE); |
759 | memblock_free(mx3_camera_base, MX31_3DS_CAMERA_BUF_SIZE); | ||
760 | memblock_remove(mx3_camera_base, MX31_3DS_CAMERA_BUF_SIZE); | ||
761 | } | 760 | } |
762 | 761 | ||
763 | MACHINE_START(MX31_3DS, "Freescale MX31PDK (3DS)") | 762 | MACHINE_START(MX31_3DS, "Freescale MX31PDK (3DS)") |