aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Chen <b02280@freescale.com>2011-11-04 16:27:04 +0800
committerEric Miao <eric.miao@canonical.com>2011-11-10 07:39:04 +0800
commit341aef5a52e202fec1052855c38dc7cb90d16277 (patch)
tree5aa78b41916bd4340f5eb872277ee3d818eb1d8a
parentafcc1eb355bb50a76b08897deb5807cc490e16a5 (diff)
downloadlinux-linaro-341aef5a52e202fec1052855c38dc7cb90d16277.tar.gz
ENGR00158360 imx MSL: fix __arch_adjust_zones function
fix __arch_adjust_zones if MXC_DMA_ZONE_SIZE if bigger than system memory Signed-off-by: Jason Chen <b02280@freescale.com>
-rw-r--r--arch/arm/plat-mxc/include/mach/memory.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/arm/plat-mxc/include/mach/memory.h b/arch/arm/plat-mxc/include/mach/memory.h
index 8275e6a2054..3e99f2ed97a 100644
--- a/arch/arm/plat-mxc/include/mach/memory.h
+++ b/arch/arm/plat-mxc/include/mach/memory.h
@@ -85,11 +85,15 @@
static inline void __arch_adjust_zones(unsigned long *zone_size,
unsigned long *zhole_size)
{
+#ifdef CONFIG_ZONE_DMA
/* Create separate zone to reserve memory for DMA */
- zone_size[1] = zone_size[0] - MXC_DMA_ZONE_SIZE;
- zone_size[0] = MXC_DMA_ZONE_SIZE;
- zhole_size[1] = zhole_size[0];
- zhole_size[0] = 0;
+ if ((zone_size[0] - zhole_size[0]) > MXC_DMA_ZONE_SIZE) {
+ zone_size[1] = zone_size[0] - MXC_DMA_ZONE_SIZE;
+ zone_size[0] = MXC_DMA_ZONE_SIZE;
+ zhole_size[1] = zhole_size[0];
+ zhole_size[0] = 0;
+ }
+#endif
}
#define arch_adjust_zones(size, holes) \