From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Wed, 25 Mar 2020 16:31:08 -0400 Subject: [PATCH] fs: ext4: Fix alignment of cache buffers In-Reply-To: References: Message-ID: <20200325203108.GV5793@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, Mar 25, 2020 at 09:27:51PM +0100, Jan Kiszka wrote: > From: Jan Kiszka > > We need to align the cache buffer to ARCH_DMA_MINALIGN in order to avoid > access errors like > > CACHE: Misaligned operation at range [be0231e0, be0235e0] > > seen on the MCIMX7SABRE. > > Fixes: d5aee659f217 ("fs: ext4: cache extent data") > Signed-off-by: Jan Kiszka > --- > fs/ext4/ext4fs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/ext4/ext4fs.c b/fs/ext4/ext4fs.c > index 1c616a26a2..966b427a97 100644 > --- a/fs/ext4/ext4fs.c > +++ b/fs/ext4/ext4fs.c > @@ -288,7 +288,7 @@ int ext_cache_read(struct ext_block_cache *cache, lbaint_t block, int size) > if (cache->buf && cache->block == block && cache->size == size) > return 1; > ext_cache_fini(cache); > - cache->buf = malloc(size); > + cache->buf = memalign(ARCH_DMA_MINALIGN, size); > if (!cache->buf) > return 0; > if (!ext4fs_devread(block, 0, size, cache->buf)) { Thanks for digging in to this. Reviewed-by: Tom Rini -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: