path: root/fs/ext4/ext4_common.h
diff options
authorStephen Warren <>2012-09-18 08:05:28 +0000
committerTom Rini <>2012-09-20 11:07:26 -0700
commit55b523b7d4ab885142f77d388007eb5490ba6bf4 (patch)
tree52860da4203f49ccc80bed7e1703d41b96c7fdd7 /fs/ext4/ext4_common.h
parented34f34dbaf206dfe223f4bc2147d600fe1b0f58 (diff)
ext4: cache-align buffers so the invalidation works
DMA buffer cache invalidation requires that buffers have cache-aligned buffer locations and sizes. Use memalign() and ALLOC_CACHE_ALIGN_BUFFER() to ensure this. On Tegra at least, without this fix, the following fail commands fail in u-boot-master/ext4, but succeeded at the branch's branch point in u-boot/master. With this fix, the commands work again: ext2ls mmc 0:1 / ext2load mmc 0:1 /boot/zImage Cc: Uma Shankar <> Cc: Manjunatha C Achar <> Cc: Iqbal Shareef <> Cc: Hakgoo Lee <> Cc: Wolfgang Denk <> Cc: Tom Rini <> Signed-off-by: Stephen Warren <>
Diffstat (limited to 'fs/ext4/ext4_common.h')
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/ext4/ext4_common.h b/fs/ext4/ext4_common.h
index 801b8b848a..0af625db2b 100644
--- a/fs/ext4/ext4_common.h
+++ b/fs/ext4/ext4_common.h
@@ -55,7 +55,12 @@
#define SUPERBLOCK_SIZE 1024
#define F_FILE 1
-#define zalloc(size) calloc(1, size)
+static inline void *zalloc(size_t size)
+ void *p = memalign(ARCH_DMA_MINALIGN, size);
+ memset(p, 0, size);
+ return p;
extern unsigned long part_offset;
int ext4fs_read_inode(struct ext2_data *data, int ino,