summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>2015-08-18 13:06:37 +0200
committerTom Rini <trini@konsulko.com>2015-08-28 12:33:17 -0400
commit4519668b29bb8422ceca8e7ca9a35d5af0afe959 (patch)
treecf6361ac4f48d13dc677978ae8778e63bedba402 /fs
parent285e266b417103378c1cf1e9aea47b34731c45d0 (diff)
downloadu-boot-imx-4519668b29bb8422ceca8e7ca9a35d5af0afe959.zip
u-boot-imx-4519668b29bb8422ceca8e7ca9a35d5af0afe959.tar.gz
u-boot-imx-4519668b29bb8422ceca8e7ca9a35d5af0afe959.tar.bz2
mtd/nand/ubi: assortment of alignment fixes
Various U-Boot adoptions/extensions to MTD/NAND/UBI did not take buffer alignment into account which led to failures of the following form: ERROR: v7_dcache_inval_range - start address is not aligned - 0x1f7f0108 ERROR: v7_dcache_inval_range - stop address is not aligned - 0x1f7f1108 Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Scott Wood <scottwood@freescale.com> [trini: Add __UBOOT__ hunk to lib/zlib/zutil.c due to malloc.h in common.h] Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/ubifs/super.c5
-rw-r--r--fs/ubifs/ubifs.c4
2 files changed, 5 insertions, 4 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 10f8fff..0bf52db 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -57,7 +57,8 @@ struct inode *iget_locked(struct super_block *sb, unsigned long ino)
{
struct inode *inode;
- inode = (struct inode *)malloc(sizeof(struct ubifs_inode));
+ inode = (struct inode *)malloc_cache_aligned(
+ sizeof(struct ubifs_inode));
if (inode) {
inode->i_ino = ino;
inode->i_sb = sb;
@@ -104,7 +105,7 @@ void iput(struct inode *inode)
/*
* Allocate and use new inode
*/
- ino = (struct inode *)malloc(sizeof(struct ubifs_inode));
+ ino = (struct inode *)malloc_cache_aligned(sizeof(struct ubifs_inode));
memcpy(ino, inode, sizeof(struct ubifs_inode));
/*
diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
index 6dd6174..4daa7fa 100644
--- a/fs/ubifs/ubifs.c
+++ b/fs/ubifs/ubifs.c
@@ -108,7 +108,7 @@ static inline struct crypto_comp *crypto_alloc_comp(const char *alg_name,
struct crypto_comp *ptr;
int i = 0;
- ptr = malloc(sizeof(struct crypto_comp));
+ ptr = malloc_cache_aligned(sizeof(struct crypto_comp));
while (i < UBIFS_COMPR_TYPES_CNT) {
comp = ubifs_compressors[i];
if (!comp) {
@@ -723,7 +723,7 @@ static int do_readpage(struct ubifs_info *c, struct inode *inode,
* destination area to a multiple of
* UBIFS_BLOCK_SIZE.
*/
- buff = malloc(UBIFS_BLOCK_SIZE);
+ buff = malloc_cache_aligned(UBIFS_BLOCK_SIZE);
if (!buff) {
printf("%s: Error, malloc fails!\n",
__func__);